Skip to content

armgit / wger

Public Imported from GitHub
0

Self hosted FLOSS fitness/workout, nutrition and weight tracker

Merge branch 'docker-compose'

Roland Geider4db2a6604354
diff --cc extras/docker/development-venv/Dockerfile
index b91c10eb1,62b9a9ab8..18b5ce0a9
--- a/extras/docker/development-venv/Dockerfile
+++ b/extras/docker/development-venv/Dockerfile
@@@ -54,14 -54,7 +54,6 @@@ LABEL maintainer="Roland Geider <roland
ARG DOCKER_DIR=./extras/docker/development
EXPOSE 8000
- # Set locale to UTF8, otherwise problems with the encoding can occur, e.g.
- # when using the invoke/wger commands and bower
- RUN locale-gen en_US.UTF-8
- ENV LANG en_US.UTF-8
- ENV LANGUAGE en_US:en
- ENV LC_ALL en_US.UTF-8
-
--
# Set up the application
USER wger
COPY --chown=wger:wger . /home/wger/src
diff --cc extras/docker/development/Dockerfile
index 2b1e6e785,0e8c0445d..1d0f36048
--- a/extras/docker/development/Dockerfile
+++ b/extras/docker/development/Dockerfile
@@@ -8,17 -8,8 +8,7 @@@
#
# Run the container:
# docker run -ti -v /path/to/this/checkout:/home/wger/src --name wger.devel --publish 8000:8000 wger/devel
- #
- # (in docker) python3 manage.py download-exercise-images (optional, may take some time)
- # (in docker) python3 manage.py runserver 0.0.0.0:8000
- #
- # To stop the container:
- # sudo docker container stop wger.devel
- #
- # To start developing again
- # sudo docker container start --attach wger.devel
- #
-
##########
# Builder
##########
@@@ -44,36 -35,28 +34,27 @@@ RUN pip3 wheel --no-cache-dir --wheel-d
########
FROM wger/base:2.0-dev
LABEL maintainer="Roland Geider <[email protected]>"
-ARG DOCKER_DIR=./extras/docker/development
EXPOSE 8000
- # Set locale to UTF8, otherwise problems with the encoding can occur, e.g.
- # when using the invoke/wger commands and bower
- RUN locale-gen en_US.UTF-8
- ENV LANG en_US.UTF-8
- ENV LANGUAGE en_US:en
- ENV LC_ALL en_US.UTF-8
-
# Set up the application
- COPY --chown=wger:wger . /home/wger/src
- COPY --from=builder /usr/src/app/wheels /wheels
WORKDIR /home/wger/src
+ COPY --chown=wger:wger . /home/wger/src
+ COPY --from=builder /wheels /wheels
+ 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/* \
+ && pip3 install psycopg2-binary \
+ && pip3 install django-redis \
&& python3 setup.py develop \
- && npm install \
- && npm install bower
+ && npm install -g bower
- USER wger
- WORKDIR /home/wger/src
- RUN wger create_settings \
- --settings-path /home/wger/src/settings.py \
- --database-path /home/wger/db/database.sqlite \
- && wger bootstrap \
- --settings-path /home/wger/src/settings.py \
- --no-start-server
+ RUN chown -R wger:wger .
- # Download the exercise images
+ USER wger
RUN mkdir ~/media \
- && sed -i "/^MEDIA_ROOT/c\MEDIA_ROOT='\/home\/wger\/media'" settings.py
+ && mkdir ~/db/
- CMD ["/bin/bash"]
+ CMD ["/home/wger/entrypoint.sh"]
diff --cc extras/docker/development/README.md
index bea96ca12,569787ed6..1e5b2ccb8
--- a/extras/docker/development/README.md
+++ b/extras/docker/development/README.md
@@@ -39,8 -50,8 +50,7 @@@ To start developing again
```sudo docker container start --attach wger.devel```
- Building
- --------
-
+ ## Building
If you build this yourself, keep in mind that you **must** build from the
project root!