New files
docker-compose.yml
name: djangocourse-local
services:
db:
image: postgres
env_file:
- ./.env.docker
volumes:
- postgres_data:/var/lib/postgresql/data
healthcheck:
test: pg_isready -d $${POSTGRES_DB} -U $${POSTGRES_USER}
interval: 2s
timeout: 10s
retries: 5
start_period: 30s
web:
build:
context: .
dockerfile: Dockerfile
init: true
volumes:
- .:/code
ports:
- "8000:8000"
env_file:
- ./.env.docker
restart: unless-stopped
depends_on:
db:
condition: service_healthy
volumes:
postgres_data: