demo for compose

This commit is contained in:
2025-05-05 13:44:59 +03:00
parent c3e28c48d0
commit e1e2593fa5
5 changed files with 86 additions and 0 deletions

28
docker-compose.yaml Normal file
View File

@@ -0,0 +1,28 @@
services:
db:
image: postgres:15-alpine
env_file:
- ./.env
ports:
- "5432:5432"
volumes:
- ./postgres_data:/var/lib/postgresql/data
container_name: postgres_db
restart: always
healthcheck:
test: [ "CMD-SHELL", "pg_isready", "-d", "db_prod" ]
interval: 30s
timeout: 60s
retries: 5
start_period: 80s
web:
ports:
- "80:8086"
build:
context: ./src
env_file:
- ./.env
depends_on:
db:
condition: service_healthy
restart: always