checkpoint/docker-compose.yml
2024-09-05 08:47:20 +07:00

52 lines
1.0 KiB
YAML

version: '3.9'
services:
web:
build: ./app
command: >
sh -c "
python manage.py makemigrations --noinput &&
python manage.py migrate --noinput &&
gunicorn --workers=1 project.wsgi:application --bind 0.0.0.0:8000
"
ports:
- '8000:8000'
expose:
- 8000
env_file:
- .env
depends_on:
postgres:
condition: service_healthy
volumes:
- static_volume:/home/app/web/static/
nginx:
build: ./nginx
volumes:
- static_volume:/home/app/web/static/
ports:
- "80:80"
- "443:443"
depends_on:
web:
condition: service_started
postgres:
image: postgres:15
volumes:
- postgres_data:/var/lib/postgresql/data/
env_file:
- .env
ports:
- '5432:5432'
healthcheck:
test: [ "CMD-SHELL", "pg_isready -d $${POSTGRES_DB} -U $${POSTGRES_USER}" ]
interval: 10s
timeout: 60s
retries: 3
start_period: 10s
volumes:
postgres_data:
static_volume: