LXCize Sigmah build

This commit is contained in:
Disassembler 2018-09-13 14:39:35 +02:00
parent 2c965f7cfb
commit 2b46473cb0
Signed by: Disassembler
GPG Key ID: 524BD33A0EE29499
8 changed files with 35 additions and 28 deletions

View File

@ -1,28 +0,0 @@
FROM tomcat
LABEL maintainer="Disassembler <disassembler@dasm.cz>"
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"]

35
sigmah/lxcfile Normal file
View File

@ -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