Skip to content

armgit / wger

Public Imported from GitHub
0

Self hosted FLOSS fitness/workout, nutrition and weight tracker

Set PYTHONPATH

Roland Geider1c276ed3d7e3
diff --git a/extras/docker/demo/Dockerfile b/extras/docker/demo/Dockerfile
index 7859f744a..5318cd224 100644
--- a/extras/docker/demo/Dockerfile
+++ b/extras/docker/demo/Dockerfile
@@ -104,18 +104,24 @@ USER wger
WORKDIR /home/wger/src
RUN python3 -m venv /home/wger/venv
-# Change permissions of some files and folders so the apache process
-# can access them.
+# Configure the application
+ENV PYTHONPATH=/home/wger/src
+ENV DJANGO_SETTINGS_MODULE=settings.main
+ENV MEDIA_ROOT=/home/wger/media
+ENV STATIC_ROOT=/home/wger/static
+ENV DJANGO_DB_DATABASE=/home/wger/db/database.sqlite
+ENV COMPRESS_OFFLINE=True
+
+# Change permissions of some files and folders so the apache process can access them.
RUN mkdir -p ~/static/CACHE ~/media \
&& ln -s /home/wger/static/CACHE /home/wger/src/CACHE \
&& chmod g+w /home/wger/static/CACHE
RUN --mount=type=bind,from=builder,source=/wheels,target=/wheels . /home/wger/venv/bin/activate \
- && pip install --upgrade pip \
&& pip install --no-cache /wheels/* \
&& pip install -e . \
- && sed -i "/^MEDIA_ROOT/c\MEDIA_ROOT='\/home\/wger\/media'" settings/production.py \
- && echo STATIC_ROOT=\'/home/wger/static\' >> settings/production.py \
+ && mkdir -p /home/wger/db \
+ && . /home/wger/venv/bin/activate \
&& wger bootstrap --no-process-static \
&& python3 manage.py sync-exercises \
&& wger load-online-fixtures \
diff --git a/extras/docker/production/Dockerfile b/extras/docker/production/Dockerfile
index 4c056d45e..52a2b76b3 100644
--- a/extras/docker/production/Dockerfile
+++ b/extras/docker/production/Dockerfile
@@ -79,7 +79,8 @@ ARG BUILD_DATE
ENV PATH="/home/wger/.local/bin:$PATH"
ENV APP_BUILD_COMMIT=$BUILD_COMMIT
ENV APP_BUILD_DATE=$BUILD_DATE
-ENV DJANGO_SETTINGS_MODULE='settings.main'
+ENV PYTHONPATH=/home/wger/src
+ENV DJANGO_SETTINGS_MODULE=settings.main
WORKDIR /home/wger/src
EXPOSE 8000