2 # using same image as for https://github.com/mariadb-corporation/mariadb-server-docker/blob/master/10.3/Dockerfile
4 # paths of files and directories will be interpreted as relative to the source of the context of the build.
6 ### ADD directive for the maven docker plugin
7 # 1. The maven plugin copies the jar to the artifacts assembly locaton at:
8 # ./target/docker/eu.etaxonomy/cdm-server/${project.version}/build/maven/cdm-server-${project.version}.jar
9 # 2. a tar is being created at target/docker/eu.etaxonomy/cdm-server/${project.version}/tmp/docker-build.tar
10 # which contains all files located in /target/docker/production and the artifacts.
11 # Artifacts are put into the folder maven/ inside the tar archive
12 # 3. The tar archive is passed to the dockerdaemon and is used as working directory for the build
13 #ADD target/docker/@project.groupId@/@project.artifactId@/@project.version@/build/maven/@project.build.finalName@.jar /root/cdm-server.jar
14 #ADD target/cdm-server-5.11.0-SNAPSHOT.jar /root/cdm-server.jar
15 ADD maven/@project.artifactId@-@project.version@.jar /root/cdm-server.jar
17 ARG CDMSERVER_PORT=8080
18 ARG HEAP_SIZE_ARG=1024M
19 ARG LOGDIR="/log/cdmserver"
22 ENV HEAP_SIZE=$HEAP_SIZE_ARG
24 ENV DATASOURCES=$CDM_HOME/.cdmLibrary/datasources.xml
29 ENV LC_ALL=en_US.UTF-8
31 # java options which can be overwritten
32 ENV JAVA_OPTIONS="-Dspring.profiles.active=remoting"
34 # fixed java options which must not be overwritten
35 ENV JAVA_OPTS="-Xmx$HEAP_SIZE \
36 -XX:+UseG1GC -XX:ParallelGCThreads=$CPU_CORES -XX:ConcGCThreads=$CPU_CORES \
37 -Duser.home=$CDM_HOME \
40 ENV SERVER_ARGS="-forceSchemaUpdate -jmx"
41 ENV CDMSERVER_ARGS=" -httpPort=$CDMSERVER_PORT -datasources $DATASOURCES"
43 EXPOSE $CDMSERVER_PORT
45 RUN apt-get update; apt-get install -y openjdk-8-jre-headless libjemalloc1; apt-get clean
46 ENV LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libjemalloc.so.1
49 CMD java $JAVA_OPTS $JAVA_OPTIONS -jar /root/cdm-server.jar $SERVER_ARGS $CDMSERVER_ARGS