Spotter-VM/opendatakit/Dockerfile

32 lines
1.0 KiB
Docker

FROM tomcat
MAINTAINER Disassembler <disassembler@dasm.cz>
RUN \
# Install build dependencies
apk --no-cache add --virtual .deps git git-lfs openjdk8 \
# Clone ODK aggregate
&& git clone --depth 1 https://github.com/opendatakit/aggregate.git /srv/odk \
# Compile Java web archive
&& cd /srv/odk \
&& cp gradle.properties.example gradle.properties \
&& ./gradlew war \
# Deploy web archive
&& mkdir /srv/tomcat/webapps/aggregate \
&& unzip build/libs/aggregate-*.war -d /srv/tomcat/webapps/aggregate \
# Configure Tomcat port
&& sed -i 's/port="8080"/port="8015"/g' /srv/tomcat/conf/server.xml \
# Create OS user
&& addgroup -S -g 8015 odk \
&& adduser -S -u 8015 -h /srv/tomcat -s /bin/false -g odk -G odk odk \
&& chown -R odk:odk /srv/tomcat/conf /srv/tomcat/logs /srv/tomcat/temp /srv/tomcat/webapps /srv/tomcat/work \
# Cleanup
&& apk --no-cache del .deps \
&& rm -rf /root/.gradle /root/.java /srv/odk
# VOLUME ["/srv/tomcat/.motech"]
EXPOSE 8015
USER odk
WORKDIR /srv/tomcat
CMD ["catalina.sh", "run"]