Skip to content

Commit c3fec9a

Browse files
Merge branch 'main' into standardise-pact
2 parents 9753ed7 + f17aa7e commit c3fec9a

File tree

4 files changed

+35
-10
lines changed

4 files changed

+35
-10
lines changed

.env

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
11
SERVER_PORT=4550
2-
BASE_IMAGE=openjdk:21-jdk-slim
2+
BASE_IMAGE=openjdk:21-jdk-slim
3+
JAR_FILENAME=service-cp-crime-schedulingandlisting-courtschedule-*.jar
4+
JAR_FILE_PATH=build/libs

.github/workflows/ci-build-publish.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ jobs:
9393
- name: Upload JAR Artefact
9494
uses: actions/upload-artifact@v4
9595
with:
96-
name: app-jar
96+
name: app.jar
9797
path: build/libs/${{ steps.repo_vars.outputs.artefact_name }}.jar
9898

9999
Provider-Deploy:
@@ -186,7 +186,7 @@ jobs:
186186
- name: Download JAR Artefact
187187
uses: actions/download-artifact@v4
188188
with:
189-
name: app-jar
189+
name: app.jar
190190
path: build/libs
191191

192192
- name: Set up Docker Buildx

Dockerfile

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,30 @@ ARG BASE_IMAGE
33
FROM ${BASE_IMAGE:-openjdk:21-jdk-slim}
44

55
# ---- Runtime arguments ----
6-
ARG JAR_FILENAME=app.jar
6+
ARG JAR_FILENAME
7+
ARG JAR_FILE_PATH
8+
9+
ENV JAR_FILENAME=${JAR_FILENAME:-app.jar}
10+
ENV JAR_FILE_PATH=${JAR_FILE_PATH:-build/libs}
11+
ENV JAR_FULL_PATH=$JAR_FILE_PATH/$JAR_FILENAME
12+
13+
# ---- Set runtime ENV for Spring Boot to bind port
14+
ARG SERVER_PORT
15+
ENV SERVER_PORT=${SERVER_PORT:-4550}
716

817
# ---- Dependencies ----
918
RUN apt-get update \
1019
&& apt-get install -y curl \
1120
&& rm -rf /var/lib/apt/lists/*
1221

1322
# ---- Application files ----
14-
COPY build/libs/${JAR_FILENAME} /opt/app/${JAR_FILENAME}
23+
COPY $JAR_FULL_PATH /opt/app/app.jar
1524
COPY lib/applicationinsights.json /opt/app/
1625

1726
# ---- Permissions ----
18-
RUN chmod 755 /opt/app/$JAR_FILENAME
27+
RUN chmod 755 /opt/app/app.jar
1928

2029
# ---- Runtime ----
2130
EXPOSE 4550
22-
CMD ["java", "-jar", "/opt/app/$JAR_FILENAME"]
31+
32+
CMD ["java", "-jar", "/opt/app/app.jar"]

docker-compose.yml

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
1-
version: '2.1'
1+
version: '3.8'
22

33
services:
4-
service-cp-refdata-courthearing-judges:
4+
service-cp-crime-schedulingandlisting-courtschedule:
5+
env_file:
6+
- .env
57
build:
68
context: .
79
dockerfile: Dockerfile
@@ -10,11 +12,22 @@ services:
1012
https_proxy: ${https_proxy}
1113
no_proxy: ${no_proxy}
1214
BASE_IMAGE: ${BASE_IMAGE}
15+
SERVER_PORT: ${SERVER_PORT}
16+
JAR_FILENAME: ${JAR_FILENAME}
17+
JAR_FILE_PATH: ${JAR_FILE_PATH}
18+
environment:
19+
- SERVER_PORT=${SERVER_PORT:-4550}
1320
ports:
14-
- $SERVER_PORT:$SERVER_PORT
21+
- "${SERVER_PORT:-4550}:${SERVER_PORT:-4550}"
22+
networks:
23+
- service-network
1524
healthcheck:
1625
test: [ "CMD", "curl", "-f", "http://localhost:${SERVER_PORT}/health" ]
1726
interval: 30s
1827
timeout: 10s
1928
retries: 3
2029
start_period: 5s
30+
31+
networks:
32+
service-network:
33+
name: service-cp-crime-schedulingandlisting-courtschedule-network

0 commit comments

Comments
 (0)