summaryrefslogtreecommitdiffstats
path: root/deliveries/src/main/docker/docker-files/Dockerfile
diff options
context:
space:
mode:
Diffstat (limited to 'deliveries/src/main/docker/docker-files/Dockerfile')
-rwxr-xr-xdeliveries/src/main/docker/docker-files/Dockerfile16
1 files changed, 14 insertions, 2 deletions
diff --git a/deliveries/src/main/docker/docker-files/Dockerfile b/deliveries/src/main/docker/docker-files/Dockerfile
index 0279750e2..1d95efa20 100755
--- a/deliveries/src/main/docker/docker-files/Dockerfile
+++ b/deliveries/src/main/docker/docker-files/Dockerfile
@@ -1,3 +1,10 @@
+FROM openjdk:11-jdk-slim as build
+
+ADD maven/artifacts/vid.war /stage/
+WORKDIR /vid
+RUN jar -xf /stage/vid.war
+RUN rm -f *.war
+
FROM tomcat:9-jdk11-openjdk-slim
# add vim and uncomment alias to speedup troubleshooting purpose
@@ -17,6 +24,10 @@ RUN groupadd -r $group && useradd -ms /bin/bash $user -g $group && \
mkdir /var/log/$user && \
chown -R $user:$group /var/log/$user
+# Kubernetes variables
+# set to TRUE (in capital) if on Kubernetes
+ENV ON_KUBERNETES="FALSE"
+
# MariaDB variables
ENV VID_MYSQL_HOST="vid-mariadb-docker-instance" \
VID_MYSQL_PORT="3306" \
@@ -97,9 +108,10 @@ ENV JAVA_OPTS="-Xmx1536m -Xms1536m"
ADD maven/config/server.xml ${VID_TOMCAT_PATH}
ADD maven/scripts/*.sh /tmp/vid/
-ADD maven/artifacts/vid.war /tmp/vid/stage/
-
RUN chown $user:$group /tmp/vid /usr/local/tomcat -R
+
+COPY --chown=$user:$group --from=build /vid /usr/local/tomcat/webapps/vid/
+
RUN chmod +x /tmp/vid/localize.sh
USER $user
CMD ["/tmp/vid/localize.sh"]