LXCize Motech build

This commit is contained in:
Disassembler 2018-09-13 13:39:25 +02:00
parent 444cfb58b1
commit 89b11a6112
No known key found for this signature in database
GPG Key ID: 524BD33A0EE29499
9 changed files with 31 additions and 25 deletions

View File

@ -1,25 +0,0 @@
FROM tomcat
LABEL maintainer="Disassembler <disassembler@dasm.cz>"
RUN \
# Download Motech
wget http://nexus.motechproject.org/service/local/repositories/releases/content/org/motechproject/motech-platform-server/1.3/motech-platform-server-1.3.war -O /tmp/motech.war \
&& mkdir /srv/tomcat/webapps/ROOT \
&& unzip /tmp/motech.war -d /srv/tomcat/webapps/ROOT \
# Update Postgres JDBC driver
&& rm -f /srv/tomcat/webapps/ROOT/WEB-INF/lib/postgresql-9.1-901.jdbc4.jar /srv/tomcat/webapps/ROOT/WEB-INF/bundles/postgresql-9.1-901.jdbc4.jar \
&& wget https://jdbc.postgresql.org/download/postgresql-42.2.5.jar -O /srv/tomcat/webapps/ROOT/WEB-INF/lib/postgresql-42.2.5.jar \
&& cp /srv/tomcat/webapps/ROOT/WEB-INF/lib/postgresql-42.2.5.jar /srv/tomcat/webapps/ROOT/WEB-INF/bundles/postgresql-42.2.5.jar \
# Create OS user
&& addgroup -S -g 8013 motech \
&& adduser -S -u 8013 -h /srv/tomcat -s /bin/false -g motech -G motech motech \
&& chown -R motech:motech /srv/tomcat/conf /srv/tomcat/logs /srv/tomcat/temp /srv/tomcat/webapps /srv/tomcat/work \
# Cleanup
&& rm -f /tmp/motech.war
VOLUME ["/srv/tomcat/.motech"]
EXPOSE 8080
USER motech
WORKDIR /srv/tomcat
CMD ["catalina.sh", "run"]

31
motech/lxcfile Normal file
View File

@ -0,0 +1,31 @@
IMAGE motech
LAYER shared/alpine
LAYER shared/java
LAYER shared/tomcat
LAYER motech/motech
RUN EOF
# Download Motech
wget http://nexus.motechproject.org/service/local/repositories/releases/content/org/motechproject/motech-platform-server/1.3/motech-platform-server-1.3.war -O /tmp/motech.war
mkdir /srv/tomcat/webapps/ROOT
unzip /tmp/motech.war -d /srv/tomcat/webapps/ROOT
# Update Postgres JDBC driver
rm -f /srv/tomcat/webapps/ROOT/WEB-INF/lib/postgresql-9.1-901.jdbc4.jar /srv/tomcat/webapps/ROOT/WEB-INF/bundles/postgresql-9.1-901.jdbc4.jar
wget https://jdbc.postgresql.org/download/postgresql-42.2.5.jar -O /srv/tomcat/webapps/ROOT/WEB-INF/lib/postgresql-42.2.5.jar
cp /srv/tomcat/webapps/ROOT/WEB-INF/lib/postgresql-42.2.5.jar /srv/tomcat/webapps/ROOT/WEB-INF/bundles/postgresql-42.2.5.jar
# Create OS user
addgroup -S -g 8013 motech
adduser -S -u 8013 -h /srv/tomcat -s /bin/false -g motech -G motech motech
chown -R motech:motech /srv/tomcat/conf /srv/tomcat/logs /srv/tomcat/temp /srv/tomcat/webapps /srv/tomcat/work
# Cleanup
rm -f /tmp/motech.war
EOF
MOUNT /srv/motech/conf srv/tomcat/.motech
USER 8013 8013
WORKDIR /srv/tomcat
CMD /usr/bin/catalina.sh run