version: "3.7" services: db: image: postgres:11 # pin postgres to a major version environment: - PGDATA=/db-data - POSTGRES_PASSWORD=postgres # has to correspond with POSTGRES_PASSWORD in APP volumes: - db:/db-data:rw app: image: babybuddy/babybuddy # See README.md#configuration for other environment configuration options. environment: - ALLOWED_HOSTS=* - DJANGO_SETTINGS_MODULE=babybuddy.settings.docker - SECRET_KEY=5 - TIME_ZONE=Europe/Berlin - POSTGRES_PASSWORD=postgres - DEBUG=False # Turn to False in production volumes: - media:/app/media:rw # 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 && python manage.py collectstatic --noinput && gunicorn babybuddy.wsgi -b :8000 --log-level=info' ports: - "8000:8000" depends_on: - db volumes: db: {} media: {}