LXCize Ushahidi build

This commit is contained in:
Disassembler 2018-09-13 14:44:32 +02:00
parent 2b46473cb0
commit ea4b883b3f
No known key found for this signature in database
GPG Key ID: 524BD33A0EE29499
19 changed files with 38 additions and 33 deletions

View File

@ -1,33 +0,0 @@
FROM php
LABEL maintainer="Disassembler <disassembler@dasm.cz>"
RUN \
# Install runtime dependencies
apk --no-cache add php7-curl php7-imap php7-mysqli php7-pdo_mysql
RUN \
# Download Ushahidi
wget https://github.com/ushahidi/platform-client/releases/download/v3.12.3/ushahidi-platform-client-bundle-v3.12.3.tar.gz -O /tmp/ushahidi-platform-client-bundle.tar.gz \
&& wget https://github.com/ushahidi/platform/releases/download/v3.12.3/ushahidi-platform-bundle-v3.12.3.tar.gz -O /tmp/ushahidi-platform-bundle.tar.gz \
&& tar xzf /tmp/ushahidi-platform-client-bundle.tar.gz -C /srv \
&& mv /srv/ushahidi-platform-client-bundle-v3.12.3 /srv/ushahidi \
&& tar xzf /tmp/ushahidi-platform-bundle.tar.gz -C /srv/ushahidi \
&& mv /srv/ushahidi/ushahidi-platform-bundle-v3.12.3 /srv/ushahidi/platform \
# Create OS user
&& addgroup -S -g 8014 ushahidi \
&& adduser -S -u 8014 -h /srv/ushahidi -s /bin/false -g ushahidi -G ushahidi ushahidi \
&& chown -R ushahidi:ushahidi /srv/ushahidi/platform/application/logs /srv/ushahidi/platform/application/cache /srv/ushahidi/platform/application/media/uploads \
# Cleanup
&& rm -rf /tmp/ushahidi-platform-client-bundle.tar.gz /tmp/ushahidi-platform-bundle.tar.gz
COPY docker/ /
RUN \
# Patch Previewers
cd /srv/ushahidi \
&& patch -p0 <aura.patch
VOLUME ["/srv/ushahidi/platform/application/media/uploads"]
EXPOSE 8080
CMD ["s6-svscan", "/etc/services.d"]

38
ushahidi/lxcfile Normal file
View File

@ -0,0 +1,38 @@
IMAGE ushahidi
LAYER shared/alpine
LAYER shared/php
LAYER ushahidi/ushahidi
RUN EOF
# Install runtime dependencies
apk --no-cache add php7-curl php7-imap php7-mysqli php7-pdo_mysql
# Download Ushahidi
wget https://github.com/ushahidi/platform-client/releases/download/v3.12.3/ushahidi-platform-client-bundle-v3.12.3.tar.gz -O /tmp/ushahidi-platform-client-bundle.tar.gz
wget https://github.com/ushahidi/platform/releases/download/v3.12.3/ushahidi-platform-bundle-v3.12.3.tar.gz -O /tmp/ushahidi-platform-bundle.tar.gz
tar xzf /tmp/ushahidi-platform-client-bundle.tar.gz -C /srv
mv /srv/ushahidi-platform-client-bundle-v3.12.3 /srv/ushahidi
tar xzf /tmp/ushahidi-platform-bundle.tar.gz -C /srv/ushahidi
mv /srv/ushahidi/ushahidi-platform-bundle-v3.12.3 /srv/ushahidi/platform
# Create OS user
addgroup -S -g 8014 ushahidi
adduser -S -u 8014 -h /srv/ushahidi -s /bin/false -g ushahidi -G ushahidi ushahidi
chown -R ushahidi:ushahidi /srv/ushahidi/platform/application/logs /srv/ushahidi/platform/application/cache /srv/ushahidi/platform/application/media/uploads
# Cleanup
rm -rf /tmp/ushahidi-platform-client-bundle.tar.gz /tmp/ushahidi-platform-bundle.tar.gz
EOF
COPY lxc
RUN EOF
# Patch Previewers
cd /srv/ushahidi
patch -p0 <aura.patch
rm aura.patch
EOF
MOUNT /srv/ushahidi/data srv/ushahidi/platform/application/media/uploads
CMD /bin/s6-svscan /etc/services.d