Skip to content

Commit

Permalink
Basic working Docker-Compose setup - postgres image & django image.
Browse files Browse the repository at this point in the history
  • Loading branch information
rasselbock committed Apr 4, 2016
1 parent a2f2eb2 commit 8a78c94
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 15 deletions.
3 changes: 3 additions & 0 deletions demo/local_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@
}
}

STATIC_ROOT = "/webapp/static"
MEDIA_ROOT = "/webapp/media"

# CACHE_BACKEND = 'dummy:///'
CACHE_BACKEND = 'locmem:///'

Expand Down
5 changes: 3 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,12 @@ services:
build:
context: .
dockerfile: Dockerfile-postgres
nadine:
ports:
- "5432:5432"
django:
build:
context: .
dockerfile: Dockerfile-nadine
command: python manage.py runserver 0.0.0.0:8000
ports:
- "8000:8000"
depends_on:
Expand Down
28 changes: 15 additions & 13 deletions docker-entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,19 +1,21 @@
#!/bin/bash
python manage.py migrate # Apply database migrations
python manage.py collectstatic --noinput # Collect static files
#python manage.py collectstatic --noinput # Collect static files

# Prepare log files and start outputting logs to stdout
touch /webapp/logs/gunicorn.log
touch /webapp/logs/access.log
tail -n 0 -f /webapp/logs/*.log &
#touch /webapp/logs/gunicorn.log
#touch /webapp/logs/access.log
#tail -n 0 -f /webapp/logs/*.log &

# Start Gunicorn processes
echo Starting Gunicorn.
exec gunicorn nadine.wsgi:application \
--name nadine_django \
--bind 0.0.0.0:8000 \
--workers 3 \
--log-level=info \
--log-file=/webapp/logs/gunicorn.log \
--access-logfile=/webapp/logs/access.log \
"$@"
#echo Starting Gunicorn.
#exec gunicorn nadine.wsgi:application \
# --name nadine_django \
# --bind 0.0.0.0:8000 \
# --workers 3 \
# --log-level=info \
# --log-file=/webapp/logs/gunicorn.log \
# --access-logfile=/webapp/logs/access.log \
# "$@"

python manage.py runserver 0.0.0.0:8000

0 comments on commit 8a78c94

Please sign in to comment.