Project

General

Profile

Download (2.76 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
ENV TZ=CET
38

    
39
EXPOSE $CDMSERVER_PORT
40

    
41
RUN apt-get update; apt-get install -y openjdk-8-jre-headless libjemalloc1; apt-get clean
42
#set encoding
43
#RUN apt-get clean && apt-get update && apt-get install -y locales locales-all
44
#RUN sed -i -e 's/# en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen && \
45
#    locale-gen
46
#RUN export LC_ALL=en_US.UTF-8
47
#RUN export LANG=en_US.UTF-8
48
#RUN locale-gen en_US.UTF-8
49
#ENV LANG en_US.UTF-8
50
#ENV LANGUAGE en_US:en
51
#ENV LC_ALL en_US.UTF-8
52

    
53
RUN apt-get update && apt-get install -y locales && rm -rf /var/lib/apt/lists/* \
54
 && locale-gen "en_US.UTF-8"
55
ENV LANG=en_US.UTF-8 \
56
    LANGUAGE=en_US:en \
57
    LC_ALL=en_US.UTF-8
58

    
59
ENV LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libjemalloc.so.1
60

    
61
RUN apt-get update && apt-get install -y ssmtp && rm -rf /var/lib/apt/lists/*
62

    
63
COPY ssmtp.conf /etc/ssmtp/ssmtp.conf
64

    
65
RUN apt-get update && apt-get install -y iproute2 && rm -rf /var/lib/apt/lists/*
66

    
67
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
68

    
69

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