generated from hmcts/service-hmcts-crime-springboot-template
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile
More file actions
36 lines (27 loc) · 934 Bytes
/
Dockerfile
File metadata and controls
36 lines (27 loc) · 934 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# ---- Base image (default fallback) ----
ARG BASE_IMAGE
FROM ${BASE_IMAGE:-openjdk:21-jdk-slim}
# ---- Runtime arguments ----
ARG JAR_FILENAME
ARG JAR_FILE_PATH
ENV JAR_FILENAME=${JAR_FILENAME:-app.jar}
ENV JAR_FILE_PATH=${JAR_FILE_PATH:-build/libs}
ENV JAR_FULL_PATH=$JAR_FILE_PATH/$JAR_FILENAME
# ---- Set runtime ENV for Spring Boot to bind port
ARG SERVER_PORT
ENV SERVER_PORT=${SERVER_PORT:-4550}
# ---- Dependencies ----
RUN apt-get update \
&& apt-get install -y curl \
&& rm -rf /var/lib/apt/lists/*
# ---- Application files ----
COPY $JAR_FULL_PATH /opt/app/app.jar
COPY lib/applicationinsights.json /opt/app/
# ---- Permissions ----
RUN chmod 755 /opt/app/app.jar
# ---- Runtime ----
EXPOSE 4550
# Documented runtime configuration
# JWT secret for token verification (Base64-encoded HS256 key)
ENV JWT_SECRET_KEY="it-must-be-a-string-secret-at-least-256-bits-long"
CMD ["java", "-jar", "/opt/app/app.jar"]