forked from esnet/sense-rm
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
46 lines (39 loc) · 1.55 KB
/
Dockerfile
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
FROM maven:3-openjdk-17 AS MAVEN_BUILD
MAINTAINER John MacAuley <macauley@es.net>
ENV BUILD_HOME /home/sense
ENV HOME /sense-rm
WORKDIR $HOME
COPY . .
RUN mvn clean install -Dmaven.test.skip=true -Ddocker.nocache
FROM openjdk:17
ENV HOME /sense-rm
ENV LOGBACK "file:$HOME/config/logback.xml"
ENV CONFIG_DIR "file:$HOME/config/"
# SSL options.
ENV TRUSTSTORE $HOME/pkcs/truststore.p12
ENV KEYSTORE $HOME/pkcs/keystore.p12
ENV STORETYPE "PKCS12"
ENV PASSWORD "changeit"
# Add any debug options here.
#DEBUG_OPTS: "-Djavax.net.debug=ssl:handshake:verbose:keymanager:trustmanager -Djava.security.debug=access:stack:certpath"
ENV DEBUG_OPTS ""
# We add these SSL options to a separate variable so they can be overridden if needed.
ENV SSL_OPTS "-Djavax.net.ssl.trustStore=$TRUSTSTORE -Djavax.net.ssl.trustStorePassword=$PASSWORD \
-Djavax.net.ssl.trustStoreType=$STORETYPE -Djavax.net.ssl.keyStore=$KEYSTORE \
-Djavax.net.ssl.keyStorePassword=$PASSWORD -Djavax.net.ssl.keyStoreType=$STORETYPE"
USER 1000:1000
WORKDIR $HOME
COPY --from=MAVEN_BUILD $HOME/rm/target/rm-0.1.0.jar ./sense-rm.jar
COPY --from=MAVEN_BUILD $HOME/config ./config
EXPOSE 8080/tcp
CMD java \
-Xmx1024m -Djava.net.preferIPv4Stack=true \
-Dcom.sun.xml.bind.v2.runtime.JAXBContextImpl.fastBoot=true \
-Dbasedir="$HOME" \
-Dlogback.configurationFile=$LOGBACK \
-Dlogging.config=$LOGBACK \
$SSL_OPTS \
$DEBUG_OPTS \
-XX:+StartAttachListener \
-jar "$HOME/sense-rm.jar" \
--spring.config.location=$CONFIG_DIR