Make docker-compose examples unicorn-appropriate

See https://pythonspeed.com/articles/gunicorn-in-docker/

Fixes https://github.com/babybuddy/babybuddy/issues/227
This commit is contained in:
Ohad Lutzky 2021-06-25 19:52:34 +01:00 committed by Christopher Charbonneau Wells
parent 1689bc8e20
commit 1e36cb2211
2 changed files with 12 additions and 2 deletions

View File

@ -15,7 +15,12 @@ services:
volumes: volumes:
- data:/app/data:rw - data:/app/data:rw
- media:/app/media:rw - media:/app/media:rw
command: bash -c 'python manage.py migrate --noinput && python manage.py createcachetable && gunicorn babybuddy.wsgi -b :8000 --log-level=info' command: |-
bash -c 'python manage.py migrate --noinput &&
python manage.py createcachetable &&
gunicorn babybuddy.wsgi -b :8000 --log-level=info \
--worker-tmp-dir=/dev/shm --log-file=- \
--workers=2 --threads=4 --worker-class=gthread'
ports: ports:
- "8000:8000" # For Portainer, select another port for babybuddy such as 7000, for example "7000:8000" - "8000:8000" # For Portainer, select another port for babybuddy such as 7000, for example "7000:8000"
restart: unless-stopped restart: unless-stopped

View File

@ -27,7 +27,12 @@ services:
volumes: volumes:
- media:/app/media:rw - media:/app/media:rw
# Sleep 5 seconds to allow the db to to come up; # Sleep 5 seconds to allow the db to to come up;
command: bash -c 'sleep 5 && python manage.py migrate --noinput && python manage.py createcachetable && gunicorn babybuddy.wsgi -b :8000 --log-level=info' command: |-
bash -c 'python manage.py migrate --noinput &&
python manage.py createcachetable &&
gunicorn babybuddy.wsgi -b :8000 --log-level=info \
--worker-tmp-dir=/dev/shm --log-file=- \
--workers=2 --threads=4 --worker-class=gthread'
ports: ports:
- "8000:8000" # For Portainer, select another port for babybuddy such as 7000, for example "7000:8000" - "8000:8000" # For Portainer, select another port for babybuddy such as 7000, for example "7000:8000"
restart: unless-stopped restart: unless-stopped