Spotter-VM/opendatakit/lxcfile

41 lines
1.3 KiB
Plaintext
Raw Normal View History

2018-09-13 13:42:36 +02:00
IMAGE opendatakit
LAYER shared/alpine3.9
LAYER shared/alpine3.9-java8
LAYER shared/alpine3.9-tomcat8
2018-09-13 13:42:36 +02:00
LAYER opendatakit/opendatakit
RUN EOF
# Install build dependencies
apk --no-cache add --virtual .deps git git-lfs openjdk8
# Clone ODK aggregate
git clone --depth 1000 https://github.com/opendatakit/aggregate.git /srv/opendatakit
git -C /srv/opendatakit checkout c285f1c
2018-09-13 13:42:36 +02:00
# Compile Java web archive
cd /srv/opendatakit
cp gradle.properties.example gradle.properties
./gradlew war
# Deploy web archive
mkdir /srv/tomcat/webapps/ROOT
unzip build/libs/aggregate-*.war -d /srv/tomcat/webapps/ROOT
# 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/opendatakit
EOF
2018-09-14 18:13:11 +02:00
MOUNT FILE /srv/opendatakit/conf/server.xml srv/tomcat/conf/server.xml
MOUNT FILE /srv/opendatakit/conf/jdbc.properties srv/tomcat/webapps/ROOT/WEB-INF/classes/jdbc.properties
MOUNT FILE /srv/opendatakit/conf/security.properties srv/tomcat/webapps/ROOT/WEB-INF/classes/security.properties
2018-09-13 14:58:03 +02:00
2018-09-13 13:42:36 +02:00
USER 8015 8015
WORKDIR /srv/tomcat
2018-09-13 16:21:16 +02:00
CMD catalina.sh run