Skip to content

armgit / wger

Public Imported from GitHub
0

Self hosted FLOSS fitness/workout, nutrition and weight tracker

Cleanup requirements files

Roland Geider96b1f5027456
diff --git a/.travis.yml b/.travis.yml
index 243260206..e0b8d4e67 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -27,7 +27,7 @@ env:
# Install the application
install:
# Install requirements
- - pip install -r requirements_devel.txt
+ - pip install -r requirements_dev.txt
- python setup.py develop
- cd wger
- if [[ "$DB" = "postgresql" ]]; then pip install psycopg2; fi
diff --git a/MANIFEST.in b/MANIFEST.in
index 69dc7c1fa..b29980052 100644
--- a/MANIFEST.in
+++ b/MANIFEST.in
@@ -4,7 +4,7 @@ include AUTHORS.txt
include AGPL.txt
include CC-BY-SA.txt
include requirements.txt
-include requirements_devel.txt
+include requirements_dev.txt
# Application folder as well as extras
recursive-include extras *.*
diff --git a/docs/development.rst b/docs/development.rst
index 967108a51..6da84fdfb 100644
--- a/docs/development.rst
+++ b/docs/development.rst
@@ -26,7 +26,7 @@ Install Requirements
~~~~~~~~~~~~~~~~~~~~
::
- $ pip install -r requirements_devel.txt
+ $ pip install -r requirements_dev.txt
$ npm install -g yarn sass
$ python setup.py develop
diff --git a/extras/docker/apache/Dockerfile b/extras/docker/apache/Dockerfile
index 7301c59f5..5b8183bfb 100644
--- a/extras/docker/apache/Dockerfile
+++ b/extras/docker/apache/Dockerfile
@@ -31,7 +31,7 @@ RUN apt-get update \
# Set up the application
COPY requirements* ./
-RUN pip3 wheel --no-cache-dir --wheel-dir /usr/src/app/wheels -r requirements_devel.txt
+RUN pip3 wheel --no-cache-dir --wheel-dir /usr/src/app/wheels -r requirements_dev.txt
########
diff --git a/extras/docker/development-venv/Dockerfile b/extras/docker/development-venv/Dockerfile
index 341e9406c..87164343b 100644
--- a/extras/docker/development-venv/Dockerfile
+++ b/extras/docker/development-venv/Dockerfile
@@ -43,7 +43,7 @@ RUN apt-get update \
# Set up the application
COPY . .
RUN pip3 install wheel \
- && pip3 wheel --no-cache-dir --wheel-dir /usr/src/app/wheels -r requirements_devel.txt
+ && pip3 wheel --no-cache-dir --wheel-dir /usr/src/app/wheels -r requirements_dev.txt
########
diff --git a/extras/docker/development/Dockerfile b/extras/docker/development/Dockerfile
index cc59f6f65..705dd2f9e 100644
--- a/extras/docker/development/Dockerfile
+++ b/extras/docker/development/Dockerfile
@@ -25,7 +25,7 @@ RUN apt-get update \
# Build the necessary python wheels
COPY requirements* ./
-RUN pip3 wheel --no-cache-dir --wheel-dir /wheels -r requirements_devel.txt
+RUN pip3 wheel --no-cache-dir --wheel-dir /wheels -r requirements_prod.txt
@@ -47,14 +47,13 @@ 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
RUN chown -R wger:wger .
USER wger
RUN mkdir ~/media \
+ && mkdir ~/static \
&& mkdir ~/db/
CMD ["/home/wger/entrypoint.sh"]
diff --git a/extras/docker/development/entrypoint.sh b/extras/docker/development/entrypoint.sh
index 4a7f45994..58a9202ee 100644
--- a/extras/docker/development/entrypoint.sh
+++ b/extras/docker/development/entrypoint.sh
@@ -25,5 +25,12 @@ then
chmod -R g+w ~wger/media
fi
-# Run the development server
-python3 manage.py runserver 0.0.0.0:8000
+# Run the server
+if [ -z "$WGER_USE_GUNICORN" ]
+then
+ python3 manage.py runserver 0.0.0.0:8000
+else
+ gunicorn wger.wsgi:application --reload --bind 0.0.0.0:8000
+fi
+
+
diff --git a/extras/docker/development/settings.py b/extras/docker/development/settings.py
index bea1370fd..bb6a5ee17 100644
--- a/extras/docker/development/settings.py
+++ b/extras/docker/development/settings.py
@@ -6,8 +6,8 @@ from wger.settings_global import *
# Use 'DEBUG = True' to get more details for server errors
-DEBUG = True
-TEMPLATES[0]['OPTIONS']['debug'] = True
+DEBUG = os.environ.get("DJANGO_DEBUG", True)
+TEMPLATES[0]['OPTIONS']['debug'] = DEBUG
ADMINS = (
('Your name', '[email protected]'),
@@ -51,9 +51,11 @@ SITE_URL = 'http://localhost:8000'
# Path to uploaded files
# Absolute filesystem path to the directory that will hold user-uploaded files.
-MEDIA_ROOT = '/home/wger/media'
+MEDIA_ROOT = os.environ.get("DJANGO_MEDIA_ROOT", '/home/wger/media')
MEDIA_URL = '/media/'
+STATIC_ROOT = os.environ.get("DJANGO_STATIC_ROOT", '/home/wger/static')
+
# Allow all hosts to access the application. Change if used in production.
ALLOWED_HOSTS = '*'
diff --git a/requirements.txt b/requirements.txt
index ed1038345..711f7c237 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -1,10 +1,7 @@
#
-# Requirements for wger for production
+# Common requirements for wger
#
-# Building/installing
-wheel
-
# Application
bleach~=3.1
django-bootstrap-breadcrumbs~=0.9
@@ -30,9 +27,6 @@ sphinx
# AWS
#boto3
-# Production
-#psycopg2
-#python-memcached
# REST API
django-cors-headers>=3.0
diff --git a/requirements_devel.txt b/requirements_dev.txt
similarity index 52%
rename from requirements_devel.txt
rename to requirements_dev.txt
index 02895e332..34d9e1ab7 100644
--- a/requirements_devel.txt
+++ b/requirements_dev.txt
@@ -1,10 +1,13 @@
#
-# Requirements for wger during development
+# Requirements for wger during development only
#
-# Production packages
+# Regular packages
-r requirements.txt
+# Building/installing
+wheel
+
# Development packages
coverage
django-debug-toolbar
diff --git a/requirements_prod.txt b/requirements_prod.txt
new file mode 100644
index 000000000..2aeec311f
--- /dev/null
+++ b/requirements_prod.txt
@@ -0,0 +1,11 @@
+#
+# Requirements for wger for production
+#
+
+# Regular packages
+-r requirements.txt
+
+gunicorn~=20.0
+psycopg2-binary
+django-redis
+