1 |
ed5ad657
|
Andreas Kohlbecker
|
FROM anapsix/alpine-java:8
|
2 |
|
|
|
3 |
|
|
# paths of files and directories will be interpreted as relative to the source of the context of the build.
|
4 |
|
|
|
5 |
|
|
### ADD directive for the maven docker plugin
|
6 |
|
|
# 1. The maven plugin copies the jar to the artifacts assembly locaton at:
|
7 |
|
|
# ./target/docker/eu.etaxonomy/cdm-server/${project.version}/build/maven/cdm-server-${project.version}.jar
|
8 |
|
|
# 2. a tar is being created at target/docker/eu.etaxonomy/cdm-server/${project.version}/tmp/docker-build.tar
|
9 |
|
|
# which contains all files located in /target/docker/production and the artifacts.
|
10 |
|
|
# Artifacts are put into the folder maven/ inside the tar archive
|
11 |
|
|
# 3. The tar archive is passed to the dockerdaemon and is used as working directory for the build
|
12 |
|
|
#ADD target/docker/@project.groupId@/@project.artifactId@/@project.version@/build/maven/@project.build.finalName@.jar /root/cdm-server.jar
|
13 |
|
|
ADD maven/@project.artifactId@-@project.version@.jar /root/cdm-server.jar
|
14 |
|
|
|
15 |
|
|
ARG CDMSERVER_PORT=8080
|
16 |
35066a11
|
Andreas Kohlbecker
|
ARG HEAP_SIZE_ARG=1024M
|
17 |
ed5ad657
|
Andreas Kohlbecker
|
ARG LOGDIR="/log/cdmserver"
|
18 |
|
|
|
19 |
|
|
ENV CDM_HOME=/data
|
20 |
35066a11
|
Andreas Kohlbecker
|
ENV HEAP_SIZE=$HEAP_SIZE_ARG
|
21 |
ed5ad657
|
Andreas Kohlbecker
|
ENV CPU_CORES=1
|
22 |
|
|
ENV DATASOURCES=$CDM_HOME/.cdmLibrary/datasources.xml
|
23 |
|
|
|
24 |
|
|
# java options which can be overwritten
|
25 |
|
|
ENV JAVA_OPTIONS="-Dspring.profiles.active=remoting"
|
26 |
|
|
|
27 |
|
|
# fixed java options which must not be overwritten
|
28 |
|
|
ARG JAVA_OPTS="-Xmx$HEAP_SIZE \
|
29 |
|
|
-XX:+UseG1GC -XX:ParallelGCThreads=$CPU_CORES -XX:ConcGCThreads=$CPU_CORES \
|
30 |
|
|
-Duser.home=$CDM_HOME $JAVA_OPTIONS"
|
31 |
|
|
|
32 |
|
|
ARG SERVER_ARGS="-forceSchemaUpdate -jmx"
|
33 |
|
|
|
34 |
|
|
ENV CDMSERVER_ARGS="-httpPort=$CDMSERVER_PORT -logdir=$LOGDIR -datasources $DATASOURCES"
|
35 |
|
|
|
36 |
|
|
EXPOSE $CDMSERVER_PORT
|
37 |
|
|
|
38 |
|
|
CMD java $JAVA_OPTS $JAVA_OPTIONS -jar /root/cdm-server.jar $SERVER_ARGS $CDMSERVER_ARGS
|