1
0
Fork 0
spejstore/docker-compose.yml

33 lines
830 B
YAML

version: "3"
services:
db:
image: postgres:15.4
restart: always
environment:
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=postgres
- POSTGRES_DB=postgres
healthcheck:
#CHANGE 1: this command checks if the database is ready, right on the source db server
test: [ "CMD-SHELL", "pg_isready" ]
interval: 1s
timeout: 1s
retries: 5
web:
build: .
restart: always
command: bash -c "python manage.py migrate && gunicorn -b 0.0.0.0:8000 --capture-output --error-logfile - --access-logfile - spejstore.wsgi:application"
volumes:
- .:/code
- /code/build_static
ports:
- "8000:8000"
depends_on:
db:
condition: service_healthy
environment:
- SPEJSTORE_CLIENT_ID
- SPEJSTORE_SECRET
- SPEJSTORE_ENV