forked from bcgov/nr-bcws-wfnews
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile_client
31 lines (25 loc) · 957 Bytes
/
Dockerfile_client
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
FROM tomcat:8.5-jdk17-openjdk
COPY *.war .
ENV TOMCAT_HOME=/usr/local/tomcat \
CATALINA_HOME=/usr/local/tomcat \
CATALINA_OUT=/usr/local/tomcat/logs \
TOMCAT_MAJOR=8 \
JAVA_OPTS="$JAVA_OPTS"
# TODO: REVERT CHOWN COMMAND TO 770 ONCE DONE TESTING
RUN apt-get update &&\
apt-get install -y telnet &&\
apt-get install -y sed &&\
rm -rf /usr/local/tomcat/webapps/ROOT &&\
mkdir /usr/local/tomcat/webapps/ROOT &&\
unzip -d /usr/local/tomcat/webapps/ROOT/ '*.war' &&\
adduser --system tomcat &&\
chown -R tomcat:0 `readlink -f ${CATALINA_HOME}` &&\
chmod -R 770 `readlink -f ${CATALINA_HOME}` &&\
chown -h tomcat:0 ${CATALINA_HOME} &&\
mkdir -p /usr/local/tomcat/temp &&\
chmod 766 /usr/local/tomcat/logs && chmod 766 /usr/local/tomcat/work && chmod 766 /usr/local/tomcat/temp
VOLUME /usr/local/tomcat/logs /usr/local/tomcat/work /usr/local/tomcat/temp
# run as tomcat user
USER tomcat
EXPOSE 8080
CMD ["catalina.sh", "run"]