Dockerfile créé avec mode production et mode développement

This commit is contained in:
Olivier DOSSMANN
2017-08-23 12:59:17 +02:00
parent 46f9fea2c2
commit ab75a6120a
7 changed files with 57 additions and 5 deletions

17
docker-entrypoint.sh Executable file
View File

@ -0,0 +1,17 @@
#!/usr/bin/env sh
set -e
# Make database writable
chown -R guest "$DB_DIR"
if [ "$1" = 'dev' ]; then
export DJANGO_SETTINGS_MODULE=collection.settings
exec python3 manage.py runserver 0.0.0.0:8000
elif [ "$1" = 'prod' ]; then
export DJANGO_SETTINGS_MODULE=collection.production
# Collect static files
python3 manage.py collectstatic --noinput --clear -v 0
exec uwsgi --ini uwsgi.ini --pythonpath "$APPS_DIR" --static-map=/static/="$STATIC_ROOT"
fi
exec "$@"