Add Ushahidi data directory as persistent volume

This commit is contained in:
Disassembler 2018-02-02 20:16:26 +01:00
parent e241c3a13e
commit 7f93df3014
No known key found for this signature in database
GPG Key ID: 524BD33A0EE29499
3 changed files with 5 additions and 1 deletions

View File

@ -13,7 +13,8 @@ export USHAHIDI_PWD=$(head -c 18 /dev/urandom | base64)
envsubst <${SOURCE_DIR}/createdb.sql | docker exec -i mariadb mysql envsubst <${SOURCE_DIR}/createdb.sql | docker exec -i mariadb mysql
# Configure Ushahidi # Configure Ushahidi
mkdir -p /srv/ushahidi/conf mkdir -p /srv/ushahidi/conf /srv/ushahidi/data
chown 8014:8014 /srv/ushahidi/data
envsubst <${SOURCE_DIR}/srv/ushahidi/conf/env >/srv/ushahidi/conf/env envsubst <${SOURCE_DIR}/srv/ushahidi/conf/env >/srv/ushahidi/conf/env
# Populate database # Populate database

View File

@ -17,11 +17,13 @@ RUN \
# Create OS user # Create OS user
&& addgroup -S -g 8014 ushahidi \ && addgroup -S -g 8014 ushahidi \
&& adduser -S -u 8014 -h /srv/ushahidi -s /bin/false -g ushahidi -G ushahidi 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 # Cleanup
&& rm -rf /tmp/ushahidi.tgz /tmp/ushahidi-platform-release-v3.8.0 && rm -rf /tmp/ushahidi.tgz /tmp/ushahidi-platform-release-v3.8.0
COPY docker/ / COPY docker/ /
VOLUME ["/srv/ushahidi/platform/application/media/uploads"]
EXPOSE 8014 EXPOSE 8014
CMD ["s6-svscan", "/etc/services.d"] CMD ["s6-svscan", "/etc/services.d"]

View File

@ -15,6 +15,7 @@ start() {
--link mariadb \ --link mariadb \
-p 127.0.0.1:8014:8014 \ -p 127.0.0.1:8014:8014 \
-v /srv/ushahidi/conf/env:/srv/ushahidi/platform/.env \ -v /srv/ushahidi/conf/env:/srv/ushahidi/platform/.env \
-v /srv/ushahidi/data:/srv/ushahidi/platform/application/media/uploads \
ushahidi ushahidi
} }