-
Notifications
You must be signed in to change notification settings - Fork 17
/
Copy pathDockerfile-REST
44 lines (34 loc) · 1.42 KB
/
Dockerfile-REST
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
FROM maven:3-jdk-11 AS builder
COPY MetFragLib/ /MetFragRelaunched/MetFragLib/
COPY MetFragCommandLine/ /MetFragRelaunched/MetFragCommandLine/
COPY MetFragR/ /MetFragRelaunched/MetFragR/
COPY MetFragTools/ /MetFragRelaunched/MetFragTools/
COPY MetFragRest/ /MetFragRelaunched/MetFragRest/
COPY MetFragWeb/ /MetFragRelaunched/MetFragWeb/
COPY pom.xml /MetFragRelaunched/
RUN printf '# local database file folder \n\
LocalDatabasesFolderForWeb = /vol/file_databases' > /MetFragRelaunched/MetFragWeb/src/main/webapp/resources/settings.properties
RUN mvn -Dhttps.protocols=TLSv1.2 -f MetFragRelaunched clean package -pl MetFragLib -pl MetFragRest -am -DskipTests
#FROM tomee:8
FROM maven:3-jdk-11
RUN set -eux; \
apt-get update; \
apt-get install -y --no-install-recommends \
zip \
; \
rm -rf /var/lib/apt/lists/*
RUN mkdir -p /usr/local/tomee/webapps/
COPY --from=builder /MetFragRelaunched/MetFragRest/target/MetFragRest-*.jar /usr/local/tomee/webapps/MetFragRest.jar
RUN printf '#!/bin/sh \n\
if [ -f "/resources/settings.properties" ] \n\
then \n\
zip -u /usr/local/tomee/webapps/MetFragRest.jar /resources/settings.properties \n\
fi \n\
if ! [ -z ${WEBPREFIX} ] \n\
then \n\
mv /usr/local/tomee/webapps/MetFragRest.jar /usr/local/tomee/webapps/${WEBPREFIX}.jar \n\
fi \n\
catalina.sh run' > /start.sh
#CMD [ "sh", "/start.sh" ]
EXPOSE 8080
CMD [ "java", "-Dserver.port=8080", "-jar", "/usr/local/tomee/webapps/MetFragRest.jar" ]