lazurit/docker-compose.yml

41 lines
808 B
YAML

services:
web:
build: ./app
container_name: web
command: >
sh -c "python manage.py collectstatic --noinput &&
uvicorn app.asgi:application --host 0.0.0.0 --port 8106"
volumes:
- ./staticfiles:/app/staticfiles
ports:
- "8106:8106"
restart: always
depends_on:
- postgres
- redis
env_file:
- .env
postgres:
image: postgres:15
volumes:
- postgres_data:/var/lib/postgresql/data/
env_file:
- .env
healthcheck:
test: [ "CMD-SHELL", "pg_isready -d $${POSTGRES_DB} -U $${POSTGRES_USER}" ]
interval: 10s
timeout: 60s
retries: 3
start_period: 10s
redis:
image: redis:7
restart: always
volumes:
- redis_data:/data
volumes:
postgres_data:
redis_data: