mirror of
https://github.com/wger-project/wger.git
synced 2026-02-17 16:07:53 +01:00
Cleanup requirements files
And add requirements file for production
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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 *.*
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
########
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
########
|
||||
|
||||
@@ -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"]
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
|
||||
@@ -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', 'your_email@example.com'),
|
||||
@@ -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 = '*'
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
11
requirements_prod.txt
Normal file
11
requirements_prod.txt
Normal file
@@ -0,0 +1,11 @@
|
||||
#
|
||||
# Requirements for wger for production
|
||||
#
|
||||
|
||||
# Regular packages
|
||||
-r requirements.txt
|
||||
|
||||
gunicorn~=20.0
|
||||
psycopg2-binary
|
||||
django-redis
|
||||
|
||||
Reference in New Issue
Block a user