Project

General

Profile

Download (1.96 KB) Statistics
| Branch: | Tag: | Revision:
1
FROM ubuntu:bionic
2
# using same image as for https://github.com/mariadb-corporation/mariadb-server-docker/blob/master/10.3/Dockerfile
3

    
4
# paths of files and directories will be interpreted as relative to the source of the context of the build.
5

    
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
16

    
17
ARG CDMSERVER_PORT=8080
18
ARG HEAP_SIZE_ARG=1024M
19
ARG LOGDIR="/log/cdmserver"
20

    
21
ENV CDM_HOME=/data
22
ENV HEAP_SIZE=$HEAP_SIZE_ARG
23
ENV CPU_CORES=1
24
ENV DATASOURCES=$CDM_HOME/.cdmLibrary/datasources.xml
25

    
26
# java options which can be overwritten
27
ENV JAVA_OPTIONS="-Dspring.profiles.active=remoting"
28

    
29
# fixed java options which must not be overwritten
30
ENV JAVA_OPTS="-Xmx$HEAP_SIZE \
31
    -XX:+UseG1GC -XX:ParallelGCThreads=$CPU_CORES -XX:ConcGCThreads=$CPU_CORES  \
32
    -Duser.home=$CDM_HOME \
33
     -Dcdm.logDir=$LOGDIR"
34

    
35
ENV SERVER_ARGS="-forceSchemaUpdate -jmx"
36
ENV CDMSERVER_ARGS=" -httpPort=$CDMSERVER_PORT -datasources $DATASOURCES"
37

    
38
EXPOSE $CDMSERVER_PORT
39

    
40
RUN apt-get update; apt-get install -y openjdk-8-jre-headless libjemalloc1; apt-get clean
41
ENV LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libjemalloc.so.1
42

    
43
CMD java $JAVA_OPTS $JAVA_OPTIONS  -jar /root/cdm-server.jar $SERVER_ARGS $CDMSERVER_ARGS
(1-1/7)