LXCize SeedDMS build

This commit is contained in:
Disassembler 2018-09-13 14:33:25 +02:00
parent 79f170ff01
commit 2c965f7cfb
Signed by: Disassembler
GPG Key ID: 524BD33A0EE29499
16 changed files with 51 additions and 45 deletions

View File

@ -1,45 +0,0 @@
FROM php
LABEL maintainer="Disassembler <disassembler@dasm.cz>"
RUN \
# Install runtime dependencies
apk --no-cache add ghostscript imagemagick libreoffice-calc libreoffice-impress libreoffice-writer php7-iconv php7-pear php7-pdo_pgsql php7-simplexml php7-xml poppler-utils ttf-opensans
RUN \
# Install unoconv
wget https://raw.githubusercontent.com/dagwieers/unoconv/master/unoconv -O /usr/bin/unoconv \
&& chmod +x /usr/bin/unoconv \
&& ln -s /usr/bin/python3 /usr/bin/python
RUN \
# Install full-featured wget to work around sourceforge bugs
apk --no-cache add wget \
# Install SeedDMS
&& wget https://sourceforge.net/projects/seeddms/files/seeddms-5.1.8/seeddms-quickstart-5.1.8.tar.gz/download -O /srv/seeddms.tgz \
&& tar xzf /srv/seeddms.tgz -C /srv \
&& mv /srv/seeddms51x /srv/seeddms \
&& rm -f /srv/seeddms.tgz \
&& chown -R root:root /srv/seeddms \
# Create OS user
&& addgroup -S -g 8010 seeddms \
&& adduser -S -u 8010 -h /srv/seeddms -s /bin/false -g seeddms -G seeddms seeddms \
&& chown -R seeddms:seeddms /srv/seeddms \
# Cleanup
&& apk --no-cache del wget \
&& mv /srv/seeddms/www/install/create_tables-postgres.sql /srv/seeddms/create_tables-postgres.sql \
&& rm -rf /srv/seeddms/seeddms/install /srv/seeddms/www/install \
&& rm -rf /srv/seeddms/data/conf /srv/seeddms/www/ext/example
COPY docker/etc/ /etc/
COPY --chown=8010:8010 docker/srv/seeddms/ /srv/seeddms/
RUN \
# Patch Previewers
cd /srv/seeddms \
&& patch -p0 <previewers.patch
VOLUME ["/srv/seeddms/conf", "/srv/seeddms/data"]
EXPOSE 8080
CMD ["s6-svscan", "/etc/services.d"]

51
seeddms/lxcfile Normal file
View File

@ -0,0 +1,51 @@
IMAGE seeddms
LAYER shared/alpine
LAYER shared/php
LAYER shared/libxml
LAYER shared/python3
LAYER seeddms/seeddms
FIXLAYER /usr/bin/fix-apk
RUN EOF
# Install runtime dependencies
apk --no-cache add ghostscript imagemagick libreoffice-calc libreoffice-impress libreoffice-writer php7-iconv php7-pear php7-pdo_pgsql php7-simplexml php7-xml poppler-utils ttf-opensans
# Install unoconv
wget https://raw.githubusercontent.com/dagwieers/unoconv/master/unoconv -O /usr/bin/unoconv
chmod +x /usr/bin/unoconv
# Install full-featured wget to work around sourceforge bugs
apk --no-cache add wget
# Install SeedDMS
wget https://sourceforge.net/projects/seeddms/files/seeddms-5.1.8/seeddms-quickstart-5.1.8.tar.gz/download -O /srv/seeddms.tgz
tar xzf /srv/seeddms.tgz -C /srv
mv /srv/seeddms51x /srv/seeddms
rm -f /srv/seeddms.tgz
EOF
COPY lxc
RUN EOF
# Patch Previewers
cd /srv/seeddms
patch -p0 <previewers.patch
rm previewers.patch
# Create OS user
addgroup -S -g 8010 seeddms
adduser -S -u 8010 -h /srv/seeddms -s /bin/false -g seeddms -G seeddms seeddms
chown -R seeddms:seeddms /srv/seeddms
# Cleanup
apk --no-cache del wget
mv /srv/seeddms/www/install/create_tables-postgres.sql /srv/seeddms/create_tables-postgres.sql
rm -rf /srv/seeddms/seeddms/install /srv/seeddms/www/install
rm -rf /srv/seeddms/data/conf /srv/seeddms/www/ext/example
EOF
MOUNT /srv/seeddms/conf srv/seeddms/conf
MOUNT /srv/seeddms/data srv/seeddms/data
CMD /bin/s6-svscan /etc/services.d