2018-03-16 16:08:18 +01:00
|
|
|
FROM tomcat
|
|
|
|
MAINTAINER Disassembler <disassembler@dasm.cz>
|
|
|
|
|
|
|
|
RUN \
|
|
|
|
# Install build dependencies
|
|
|
|
apk --no-cache add --virtual .deps git git-lfs openjdk8 \
|
|
|
|
# Clone ODK aggregate
|
2018-04-21 22:57:56 +02:00
|
|
|
&& git clone --depth 1 https://github.com/opendatakit/aggregate.git /srv/opendatakit \
|
2018-03-16 16:08:18 +01:00
|
|
|
# Compile Java web archive
|
2018-04-21 22:57:56 +02:00
|
|
|
&& cd /srv/opendatakit \
|
2018-03-16 16:08:18 +01:00
|
|
|
&& 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 \
|
|
|
|
# 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 \
|
2018-04-21 22:57:56 +02:00
|
|
|
&& rm -rf /root/.gradle /root/.java /srv/opendatakit
|
2018-03-16 16:08:18 +01:00
|
|
|
|
2018-03-25 23:14:56 +02:00
|
|
|
EXPOSE 8080
|
2018-03-16 16:08:18 +01:00
|
|
|
|
|
|
|
USER odk
|
|
|
|
WORKDIR /srv/tomcat
|
|
|
|
CMD ["catalina.sh", "run"]
|