-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
90 lines (88 loc) · 2.02 KB
/
docker-compose.yml
File metadata and controls
90 lines (88 loc) · 2.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
services:
backend:
image: python:3.13-alpine
restart: unless-stopped
container_name: fastapi_template_backend
build:
context: .
dockerfile: Dockerfile
ports:
- "8799:8799"
depends_on:
db:
condition: service_healthy
redis:
condition: service_healthy
environment:
- CURRENT_ENVIRONMENT
- DEBUG
- BACKEND_HOST
- BACKEND_PORT
- CORS_ORIGINS
- ALLOWED_HOSTS
- WORKERS_COUNT
- POSTGRES_HOST
- POSTGRES_PORT
- POSTGRES_USER
- POSTGRES_PASSWORD
- POSTGRES_DB
- POSTGRES_DB_SCHEMA
- SECRET_KEY
- ACCESS_TOKEN_EXPIRE_SECONDS
- REFRESH_TOKEN_EXPIRE_SECONDS
- LOG_TO_OPENOBSERVE
- OPENOBSERVE_URL
- OPENOBSERVE_ORG_ID
- OPENOBSERVE_STREAM_NAME
- OPENOBSERVE_ACCESS_KEY
deploy:
restart_policy:
condition: on-failure
delay: 3s
max_attempts: 3
window: 10s
networks:
- fastapi_template_network
db:
image: postgres:18-alpine
restart: unless-stopped
container_name: fastapi_template_db
environment:
- POSTGRES_USER
- POSTGRES_PASSWORD
- POSTGRES_DB
- POSTGRES_DB_SCHEMA
healthcheck:
test: ["CMD-SHELL", "pg_isready", "-d", "${POSTGRES_DB}"]
interval: 30s
timeout: 60s
retries: 5
start_period: 80s
volumes:
- fastapi_template_db_data:/var/lib/postgresql/data
networks:
- fastapi_template_network
redis:
image: redis:8-alpine
restart: unless-stopped
container_name: fastapi_template_redis
environment:
- REDIS_PASSWORD
ports:
- "6379:6379"
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 30s
timeout: 30s
retries: 5
start_period: 30s
networks:
- fastapi_template_network
networks:
fastapi_template_network:
name: fastapi_template
driver: bridge
volumes:
fastapi_template_db_data:
name: fastapi_template_db_data
driver: local