Skip to content

armgit / wger

Public Imported from GitHub
0

Self hosted FLOSS fitness/workout, nutrition and weight tracker

Fix issue with development mode

Roland Geiderd40821cdeb6a
diff --git a/docs/changelog.rst b/docs/changelog.rst
index db08be608..73337ccd0 100644
--- a/docs/changelog.rst
+++ b/docs/changelog.rst
@@ -24,7 +24,7 @@ Upgrade steps from 1.9:
🐛 Bug Fixes:
-* `#499`_, `#505`_, `#504`_, `#511`_, `#522`_
+* `#499`_, `#505`_, `#504`_, `#511`_, `#516`_, `#522`_
🧰 Maintenance:
@@ -50,6 +50,7 @@ Upgrade steps from 1.9:
.. _#504: https://github.com/wger-project/wger/issues/504
.. _#505: https://github.com/wger-project/wger/issues/505
.. _#511: https://github.com/wger-project/wger/issues/511
+.. _#516: https://github.com/wger-project/wger/issues/516
.. _#522: https://github.com/wger-project/wger/issues/522
diff --git a/extras/docker/development/Dockerfile b/extras/docker/development/Dockerfile
index 705dd2f9e..09234fe44 100644
--- a/extras/docker/development/Dockerfile
+++ b/extras/docker/development/Dockerfile
@@ -46,14 +46,14 @@ COPY ${DOCKER_DIR}/settings.py /home/wger/src
COPY ${DOCKER_DIR}/settings.py /tmp/
COPY ${DOCKER_DIR}/entrypoint.sh /home/wger/entrypoint.sh
RUN chmod +x /home/wger/entrypoint.sh
-RUN pip3 install --no-cache /wheels/* \
- && python3 setup.py develop
+RUN pip3 install --no-cache /wheels/*
RUN chown -R wger:wger .
USER wger
RUN mkdir ~/media \
&& mkdir ~/static \
- && mkdir ~/db/
+ && mkdir ~/db/ \
+ && python3 setup.py develop
CMD ["/home/wger/entrypoint.sh"]
diff --git a/extras/docker/development/entrypoint.sh b/extras/docker/development/entrypoint.sh
index 0f7890f25..5cfd3942a 100644
--- a/extras/docker/development/entrypoint.sh
+++ b/extras/docker/development/entrypoint.sh
@@ -16,15 +16,21 @@ if [[ "$DJANGO_DB_PORT" == "5432" ]]; then
echo "PostgreSQL started :)"
fi
-# Bootstrap the application
-wger bootstrap
-
-if [[ "$WGER_DOWNLOAD_IMGS" == "TRUE" ]];
+# The python wger package needs to be installed in development mode.
+# If the created folder does not exist (e.g. because this image was mounted
+# after a first checkout), repeat the process.
+if [ ! -d "/home/wger/src/wger.egg-info" ];
then
- wger download-exercise-images
- chmod -R g+w ~wger/media
+ python3 setup.py develop --user
fi
+# Bootstrap the application
+# * Load the fixtures with exercises, ingredients, etc
+# * Create an admin user
+# * Download JS and CSS files
+# * Compile custom bootstrap theme
+wger bootstrap
+
# Collect static files
if [[ "$DJANGO_DEBUG" == "False" ]];
then
@@ -38,5 +44,3 @@ then
else
python3 manage.py runserver 0.0.0.0:8000
fi
-
-