From 2b46473cb0240702bdb9acc03a056e78b86ef69a Mon Sep 17 00:00:00 2001 From: Disassembler Date: Thu, 13 Sep 2018 14:39:35 +0200 Subject: [PATCH] LXCize Sigmah build --- sigmah/Dockerfile | 28 --------------- .../sigmah/WEB-INF/classes/logback.xml | 0 sigmah/lxcfile | 35 +++++++++++++++++++ sigmah/{build.sh => setup.sh} | 0 sigmah/{ => setup}/createdb.sql | 0 sigmah/{ => setup}/etc/init.d/sigmah | 0 .../srv/sigmah/conf/persistence.xml | 0 .../srv/sigmah/conf/sigmah.properties | 0 8 files changed, 35 insertions(+), 28 deletions(-) delete mode 100644 sigmah/Dockerfile rename sigmah/{docker => lxc}/srv/tomcat/webapps/sigmah/WEB-INF/classes/logback.xml (100%) create mode 100644 sigmah/lxcfile rename sigmah/{build.sh => setup.sh} (100%) rename sigmah/{ => setup}/createdb.sql (100%) rename sigmah/{ => setup}/etc/init.d/sigmah (100%) rename sigmah/{ => setup}/srv/sigmah/conf/persistence.xml (100%) rename sigmah/{ => setup}/srv/sigmah/conf/sigmah.properties (100%) diff --git a/sigmah/Dockerfile b/sigmah/Dockerfile deleted file mode 100644 index 3b7595c..0000000 --- a/sigmah/Dockerfile +++ /dev/null @@ -1,28 +0,0 @@ -FROM tomcat -LABEL maintainer="Disassembler " - -RUN \ - # Download Sigmah - wget https://github.com/sigmah-dev/sigmah/releases/download/v2.0.2/sigmah-2.0.2.war -O /tmp/sigmah.war \ - && mkdir /srv/tomcat/webapps/sigmah \ - && unzip /tmp/sigmah.war -d /srv/tomcat/webapps/sigmah \ - # Update Postgres JDBC driver - && rm /srv/tomcat/webapps/sigmah/WEB-INF/lib/postgresql-9.1-901-1.jdbc4.jar \ - && wget https://jdbc.postgresql.org/download/postgresql-42.2.5.jar -O /srv/tomcat/webapps/sigmah/WEB-INF/lib/postgresql-42.2.5.jar \ - # Remove logging config - && rm /srv/tomcat/webapps/sigmah/WEB-INF/classes/logback.xml \ - # Create OS user - && addgroup -S -g 8011 sigmah \ - && adduser -S -u 8011 -h /srv/tomcat -s /bin/false -g sigmah -G sigmah sigmah \ - && chown -R sigmah:sigmah /srv/tomcat/conf /srv/tomcat/logs /srv/tomcat/temp /srv/tomcat/webapps /srv/tomcat/work \ - # Cleanup - && rm /tmp/sigmah.war - -COPY docker/ / - -VOLUME ["/srv/sigmah/data"] -EXPOSE 8080 - -USER sigmah -WORKDIR /srv/tomcat -CMD ["catalina.sh", "run"] diff --git a/sigmah/docker/srv/tomcat/webapps/sigmah/WEB-INF/classes/logback.xml b/sigmah/lxc/srv/tomcat/webapps/sigmah/WEB-INF/classes/logback.xml similarity index 100% rename from sigmah/docker/srv/tomcat/webapps/sigmah/WEB-INF/classes/logback.xml rename to sigmah/lxc/srv/tomcat/webapps/sigmah/WEB-INF/classes/logback.xml diff --git a/sigmah/lxcfile b/sigmah/lxcfile new file mode 100644 index 0000000..aa94942 --- /dev/null +++ b/sigmah/lxcfile @@ -0,0 +1,35 @@ +IMAGE sigmah +LAYER shared/alpine +LAYER shared/java +LAYER shared/tomcat +LAYER sigmah/sigmah + +RUN EOF + # Download Sigmah + wget https://github.com/sigmah-dev/sigmah/releases/download/v2.0.2/sigmah-2.0.2.war -O /tmp/sigmah.war + mkdir /srv/tomcat/webapps/sigmah + unzip /tmp/sigmah.war -d /srv/tomcat/webapps/sigmah + + # Update Postgres JDBC driver + rm /srv/tomcat/webapps/sigmah/WEB-INF/lib/postgresql-9.1-901-1.jdbc4.jar + wget https://jdbc.postgresql.org/download/postgresql-42.2.5.jar -O /srv/tomcat/webapps/sigmah/WEB-INF/lib/postgresql-42.2.5.jar + + # Remove logging config + rm /srv/tomcat/webapps/sigmah/WEB-INF/classes/logback.xml + + # Create OS user + addgroup -S -g 8011 sigmah + adduser -S -u 8011 -h /srv/tomcat -s /bin/false -g sigmah -G sigmah sigmah + chown -R sigmah:sigmah /srv/tomcat/conf /srv/tomcat/logs /srv/tomcat/temp /srv/tomcat/webapps /srv/tomcat/work + + # Cleanup + rm /tmp/sigmah.war +EOF + +COPY lxc + +MOUNT /srv/sigmah/data srv/sigmah/data + +USER 8011 8011 +WORKDIR /srv/tomcat +CMD /usr/bin/catalina.sh run diff --git a/sigmah/build.sh b/sigmah/setup.sh similarity index 100% rename from sigmah/build.sh rename to sigmah/setup.sh diff --git a/sigmah/createdb.sql b/sigmah/setup/createdb.sql similarity index 100% rename from sigmah/createdb.sql rename to sigmah/setup/createdb.sql diff --git a/sigmah/etc/init.d/sigmah b/sigmah/setup/etc/init.d/sigmah similarity index 100% rename from sigmah/etc/init.d/sigmah rename to sigmah/setup/etc/init.d/sigmah diff --git a/sigmah/srv/sigmah/conf/persistence.xml b/sigmah/setup/srv/sigmah/conf/persistence.xml similarity index 100% rename from sigmah/srv/sigmah/conf/persistence.xml rename to sigmah/setup/srv/sigmah/conf/persistence.xml diff --git a/sigmah/srv/sigmah/conf/sigmah.properties b/sigmah/setup/srv/sigmah/conf/sigmah.properties similarity index 100% rename from sigmah/srv/sigmah/conf/sigmah.properties rename to sigmah/setup/srv/sigmah/conf/sigmah.properties