-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
61 lines (51 loc) · 1.82 KB
/
Dockerfile
File metadata and controls
61 lines (51 loc) · 1.82 KB
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
# build via (docker root = project root):
# docker build -t absagroup/status-board:latest .
#
# build [with customizations] via (docker root = project root):
# docker build -t absagroup/status-board:latest \
# --build-arg BASE_IMAGE=amazoncorretto:21.0.2 \
# --build-arg BUILD_PROXY=http://proxy.example.com:3128 \
# --build-arg PORT=54321 \
# --build-arg TRUSTED_SSL_CERTS=./myTrustedCertsStorage \
# --build-arg JAR_FILE=./someLocation/IWantThisParticularFile.jar \
# .
#
# run via:
# docker run -p 12345:12345 absagroup/status-board:latest >>log.log 2>>err.log &
#
# run [with custom config] via:
# docker run -v /absolute/path/config.conf:/opt/config/config.conf -p 12345:12345 absagroup/status-board:latest >>log.log 2>>err.log &
#
# test via:
# http://localhost:12345/health
ARG BASE_IMAGE=amazoncorretto:21.0.4
FROM $BASE_IMAGE
LABEL org.opencontainers.image.authors="ABSA"
# Proxy if needed, e.g. http://my.proxy.example.com:3128
ARG BUILD_PROXY
# Port exposed by server - should be the same as the one in server's config
ARG PORT=12345
# Directory with TRUSTED certs in PEM format
ARG TRUSTED_SSL_CERTS=./trusted_certs
# status-board jar file
ARG JAR_FILE=./target/scala-2.13/status-board-*.jar
ENV http_proxy=$BUILD_PROXY
ENV https_proxy=$BUILD_PROXY
ENV HTTP_PROXY=$BUILD_PROXY
ENV HTTPS_PROXY=$BUILD_PROXY
COPY ${JAR_FILE} /opt/app/status-board-assembly.jar
COPY ./docker_entrypoint.sh /opt/app/entrypoint.sh
RUN chmod +x /opt/app/entrypoint.sh
RUN mkdir -p /opt/certs
COPY $TRUSTED_SSL_CERTS /opt/certs/
RUN for file in `ls /opt/certs/*.pem`; \
do \
keytool -import -file $file -alias $file -cacerts -storepass changeit -noprompt; \
done
RUN chmod 755 /opt/app && \
chmod 644 /opt/app/status-board-assembly.jar && \
chmod 755 /opt/app/entrypoint.sh
USER 10001:10001
EXPOSE $PORT
WORKDIR /opt/app
ENTRYPOINT ["./entrypoint.sh"]