From 05bf6da6cee72327d0f8525d899527b5a81a4feb Mon Sep 17 00:00:00 2001 From: Disassembler Date: Thu, 13 Sep 2018 13:42:36 +0200 Subject: [PATCH] LXCize ODK build --- opendatakit/Dockerfile | 28 --------------- opendatakit/lxcfile | 35 +++++++++++++++++++ opendatakit/{build.sh => setup.sh} | 0 opendatakit/{ => setup}/adminpwd.sql | 0 opendatakit/{ => setup}/createdb.sql | 0 .../{ => setup}/etc/init.d/opendatakit | 0 .../srv/opendatakit/conf/jdbc.properties | 0 .../srv/opendatakit/conf/security.properties | 0 .../srv/opendatakit/conf/server.xml | 0 .../{ => setup}/srv/opendatakit/update-url.sh | 0 10 files changed, 35 insertions(+), 28 deletions(-) delete mode 100644 opendatakit/Dockerfile create mode 100644 opendatakit/lxcfile rename opendatakit/{build.sh => setup.sh} (100%) rename opendatakit/{ => setup}/adminpwd.sql (100%) rename opendatakit/{ => setup}/createdb.sql (100%) rename opendatakit/{ => setup}/etc/init.d/opendatakit (100%) rename opendatakit/{ => setup}/srv/opendatakit/conf/jdbc.properties (100%) rename opendatakit/{ => setup}/srv/opendatakit/conf/security.properties (100%) rename opendatakit/{ => setup}/srv/opendatakit/conf/server.xml (100%) rename opendatakit/{ => setup}/srv/opendatakit/update-url.sh (100%) diff --git a/opendatakit/Dockerfile b/opendatakit/Dockerfile deleted file mode 100644 index a14d0c6..0000000 --- a/opendatakit/Dockerfile +++ /dev/null @@ -1,28 +0,0 @@ -FROM tomcat -LABEL maintainer="Disassembler " - -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/opendatakit \ - # 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 - -EXPOSE 8080 - -USER odk -WORKDIR /srv/tomcat -CMD ["catalina.sh", "run"] diff --git a/opendatakit/lxcfile b/opendatakit/lxcfile new file mode 100644 index 0000000..a63758b --- /dev/null +++ b/opendatakit/lxcfile @@ -0,0 +1,35 @@ +IMAGE opendatakit +LAYER shared/alpine +LAYER shared/java +LAYER shared/tomcat +LAYER opendatakit/opendatakit + +RUN EOF + # 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/opendatakit + + # 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 + +USER 8015 8015 +WORKDIR /srv/tomcat +CMD /usr/bin/catalina.sh run diff --git a/opendatakit/build.sh b/opendatakit/setup.sh similarity index 100% rename from opendatakit/build.sh rename to opendatakit/setup.sh diff --git a/opendatakit/adminpwd.sql b/opendatakit/setup/adminpwd.sql similarity index 100% rename from opendatakit/adminpwd.sql rename to opendatakit/setup/adminpwd.sql diff --git a/opendatakit/createdb.sql b/opendatakit/setup/createdb.sql similarity index 100% rename from opendatakit/createdb.sql rename to opendatakit/setup/createdb.sql diff --git a/opendatakit/etc/init.d/opendatakit b/opendatakit/setup/etc/init.d/opendatakit similarity index 100% rename from opendatakit/etc/init.d/opendatakit rename to opendatakit/setup/etc/init.d/opendatakit diff --git a/opendatakit/srv/opendatakit/conf/jdbc.properties b/opendatakit/setup/srv/opendatakit/conf/jdbc.properties similarity index 100% rename from opendatakit/srv/opendatakit/conf/jdbc.properties rename to opendatakit/setup/srv/opendatakit/conf/jdbc.properties diff --git a/opendatakit/srv/opendatakit/conf/security.properties b/opendatakit/setup/srv/opendatakit/conf/security.properties similarity index 100% rename from opendatakit/srv/opendatakit/conf/security.properties rename to opendatakit/setup/srv/opendatakit/conf/security.properties diff --git a/opendatakit/srv/opendatakit/conf/server.xml b/opendatakit/setup/srv/opendatakit/conf/server.xml similarity index 100% rename from opendatakit/srv/opendatakit/conf/server.xml rename to opendatakit/setup/srv/opendatakit/conf/server.xml diff --git a/opendatakit/srv/opendatakit/update-url.sh b/opendatakit/setup/srv/opendatakit/update-url.sh similarity index 100% rename from opendatakit/srv/opendatakit/update-url.sh rename to opendatakit/setup/srv/opendatakit/update-url.sh