Add static config

This commit is contained in:
redfast00 2020-07-25 15:06:59 +02:00
parent a3891494af
commit db4074ab33
3 changed files with 6 additions and 0 deletions

View file

@ -137,6 +137,8 @@ STATICFILES_DIRS = [
os.path.join(BASE_DIR, "static"), os.path.join(BASE_DIR, "static"),
] ]
STATIC_ROOT = os.getenv('STATIC_ROOT')
# Celery # Celery
CELERY_BROKER = os.getenv('CELERY_BROKER', 'redis://localhost:6379/0') CELERY_BROKER = os.getenv('CELERY_BROKER', 'redis://localhost:6379/0')

View file

@ -8,8 +8,11 @@ services:
restart: on-failure restart: on-failure
depends_on: depends_on:
- database - database
volumes:
- /var/www/kers/static:/static
command: > command: >
sh -c "./scripts/wait_for_service database 3306 && sh -c "./scripts/wait_for_service database 3306 &&
python manage.py collectstatic --no-input
python manage.py migrate && python manage.py migrate &&
python manage.py runserver 0.0.0.0:8000" python manage.py runserver 0.0.0.0:8000"

View file

@ -9,3 +9,4 @@ OAUTH_CLIENT_SECRET=REPLACEME
KERS_ADMIN_USERNAME=replaceme KERS_ADMIN_USERNAME=replaceme
KERS_ADMIN_PASSWORD=replaceme KERS_ADMIN_PASSWORD=replaceme
ALLOWED_HOSTS=localhost ALLOWED_HOSTS=localhost
STATIC_ROOT=/static