Self hosted FLOSS fitness/workout, nutrition and weight tracker
First version of docker image for development
Roland Geiderd81899b86260
diff --git a/docs/docker.rst b/docs/docker.rstnew file mode 100644index 000000000..a5e2fa962--- /dev/null+++ b/docs/docker.rst@@ -0,0 +1,41 @@+Docker+======++There are docker files available to quickly get a version of wger up and+running. They are all located under ``extras/docker``.+++Development+-----------++This image installs the application using virtualenv, uses a sqlite database+and serves it with django's development server.+++First build the image::++ docker build -t wger/devel .++Run a container and start the application::++ docker run -ti --name wger.test1 --publish 8000:8000 wger/devel+ source ~/venv/bin/activate+ python manage.py runserver 0.0.0.0:8000++Now you can access the application on port 8000 of your host (probably just+http://localhost:8000).++Depending on what you intend to do with it, you might want to map a local folder+to the container. This is interesting if e.g. you want to keep the wger source+code on your host machine and use docker only to serve it. Then you can do this::++ docker run -ti \+ --name wger.test1 \+ --publish 8005:8000 \+ --volume /path/to/local/wger/:/home/wger/src \+ wger/devel++It will mount the local path *on top* of the folder in the container, basically+exchanging one for the other. Please note that for this to work you need to+manually checkout the code to ``/path/to/local/wger/`` and create a settings file+as well.\ No newline at end of filediff --git a/docs/index.rst b/docs/index.rstindex af9b27441..b399213d2 100644--- a/docs/index.rst+++ b/docs/index.rst@@ -28,6 +28,7 @@ Installation and developmentinstallcommandsi18n+ dockerdiff --git a/extras/docker/development/Dockerfile b/extras/docker/development/Dockerfilenew file mode 100644index 000000000..826091951--- /dev/null+++ b/extras/docker/development/Dockerfile@@ -0,0 +1,36 @@+#+# Dockerimage for wger development+#+# Please consult the documentation for usage+#+#+++FROM ubuntu:15.04++MAINTAINER Roland Geider <[email protected]>+EXPOSE 8000++RUN apt-get update;\+ apt-get install -y nodejs nodejs-legacy npm git \+ python-virtualenv python3-dev \+ libjpeg8-dev zlib1g-dev libwebp-dev \+ vim++RUN adduser wger --disabled-password --gecos ""+USER wger+RUN git clone https://github.com/rolandgeider/wger.git /home/wger/src+RUN virtualenv --python python3 /home/wger/venv++WORKDIR /home/wger/src+RUN npm install bower \+ && . /home/wger/venv/bin/activate \+ && pip install --upgrade pip \+ && pip install -r requirements_devel.txt \+ && invoke create_settings \+ --settings-path /home/wger/src/settings.py \+ --database-path /home/wger/db/database.sqlite \+ && invoke bootstrap_wger --settings-path /home/wger/src/settings.py --no-start-server+++CMD ["/bin/bash"]