Skip to content

armgit / wger

Public Imported from GitHub
0

Self hosted FLOSS fitness/workout, nutrition and weight tracker

Move image download to container startup

Scott Peshak9f1abb125abb
diff --git a/extras/docker/apache/Dockerfile b/extras/docker/apache/Dockerfile
index 22316cd7a..636e8d2e5 100644
--- a/extras/docker/apache/Dockerfile
+++ b/extras/docker/apache/Dockerfile
@@ -78,10 +78,7 @@ RUN chmod o+w -R ~/db/ \
&& ln -s /home/wger/static/CACHE /home/wger/src/CACHE \
&& chmod g+w /home/wger/static/CACHE \
&& sed -i "/^MEDIA_ROOT/c\MEDIA_ROOT='\/home\/wger\/media'" settings.py \
- && python manage.py download-exercise-images \
- && chmod -R g+w ~/media \
- && echo STATIC_ROOT=\'/home/wger/static\' >> settings.py \
- && python manage.py collectstatic --noinput
+ && echo STATIC_ROOT=\'/home/wger/static\' >> settings.py
USER root
diff --git a/extras/docker/apache/entrypoint.sh b/extras/docker/apache/entrypoint.sh
index 46a5877d6..b6d03e858 100755
--- a/extras/docker/apache/entrypoint.sh
+++ b/extras/docker/apache/entrypoint.sh
@@ -2,6 +2,11 @@
/home/wger/venvwrapper migrate
+if [ "${DOWNLOAD_IMGS}" = "TRUE" ]; then
+ /home/wger/venvwrapper download-exercise-images
+ chmod -R g+w ~wger/media
+fi
+
if [ "${USE_S3}" = "TRUE" ]; then
/home/wger/venvwrapper collectstatic --no-input
/home/wger/venvwrapper compress --force