Create django superuser on startup

This commit is contained in:
Pavle Portic 2019-03-24 20:55:15 +01:00
parent e79f0ab205
commit eab2549914
Signed by: TheEdgeOfRage
GPG Key ID: 6758ACE46AA2A849
4 changed files with 5 additions and 1 deletions

View File

@ -8,5 +8,6 @@
python parser/parser.py
python manage.py migrate
echo "from django.contrib.auth.models import User; User.objects.create_superuser('${DJANGO_ADMIN_USER}', '${DJANGO_ADMIN_MAIL}', '${DJANGO_ADMIN_PASS}')" | python manage.py shell
gunicorn -w 4 --bind 0.0.0.0:80 perktree.wsgi:application

Binary file not shown.

Binary file not shown.

View File

@ -30,11 +30,14 @@ services:
environment:
SECRET_KEY: ${SECRET_KEY}
DJANGO_ENV: prod
DJANGO_ADMIN_USER: ${DJANGO_ADMIN_USER}
DJANGO_ADMIN_MAIL: ${DJANGO_ADMIN_MAIL}
DJANGO_ADMIN_PASS: ${DJANGO_ADMIN_PASS}
APP_HOST: perktree.theedgeofrage.com
DB_ENGINE: django.db.backends.mysql
DB_NAME: perktree
DB_USER: root
DB_PASSWORD: perktree-root-password
DB_PASSWORD: ${DB_PASSWORD}
DB_HOST: db
DB_PORT: 3306
PERKS_DIR: /app/static/perks