Spotter-VM/motech/Dockerfile

26 lines
1.2 KiB
Docker
Raw Normal View History

2018-01-26 21:58:29 +01:00
FROM tomcat
LABEL maintainer="Disassembler <disassembler@dasm.cz>"
2018-01-23 18:18:46 +01:00
RUN \
# Download Motech
2018-07-13 13:40:29 +02:00
wget http://nexus.motechproject.org/service/local/repositories/releases/content/org/motechproject/motech-platform-server/1.3/motech-platform-server-1.3.war -O /tmp/motech.war \
2018-04-24 23:37:18 +02:00
&& mkdir /srv/tomcat/webapps/ROOT \
&& unzip /tmp/motech.war -d /srv/tomcat/webapps/ROOT \
2018-01-23 18:18:46 +01:00
# Update Postgres JDBC driver
2018-04-24 23:37:18 +02:00
&& rm -f /srv/tomcat/webapps/ROOT/WEB-INF/lib/postgresql-9.1-901.jdbc4.jar /srv/tomcat/webapps/ROOT/WEB-INF/bundles/postgresql-9.1-901.jdbc4.jar \
2018-08-30 18:38:11 +02:00
&& wget https://jdbc.postgresql.org/download/postgresql-42.2.5.jar -O /srv/tomcat/webapps/ROOT/WEB-INF/lib/postgresql-42.2.5.jar \
&& cp /srv/tomcat/webapps/ROOT/WEB-INF/lib/postgresql-42.2.5.jar /srv/tomcat/webapps/ROOT/WEB-INF/bundles/postgresql-42.2.5.jar \
2018-01-23 18:18:46 +01:00
# Create OS user
&& addgroup -S -g 8013 motech \
&& adduser -S -u 8013 -h /srv/tomcat -s /bin/false -g motech -G motech motech \
&& chown -R motech:motech /srv/tomcat/conf /srv/tomcat/logs /srv/tomcat/temp /srv/tomcat/webapps /srv/tomcat/work \
2018-01-23 18:18:46 +01:00
# Cleanup
&& rm -f /tmp/motech.war
VOLUME ["/srv/tomcat/.motech"]
EXPOSE 8080
2018-01-23 18:18:46 +01:00
USER motech
2018-01-23 21:08:21 +01:00
WORKDIR /srv/tomcat
2018-01-23 18:18:46 +01:00
CMD ["catalina.sh", "run"]