-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcompose.yaml
More file actions
63 lines (59 loc) · 1.29 KB
/
compose.yaml
File metadata and controls
63 lines (59 loc) · 1.29 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
name: fastapitemplate
services:
db:
image: docker.io/library/postgres:18
container_name: fastapitemplate_db
restart: unless-stopped
ports:
- "5432:5432"
environment:
POSTGRES_PASSWORD: appsecret
POSTGRES_USER: appuser
POSTGRES_DB: appdb
volumes:
- db_data:/var/lib/postgresql
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER} -d ${POSTGRES_DB}"]
interval: 10s
timeout: 5s
retries: 5
start_period: 30s
networks:
- net
backend:
build:
context: .
dockerfile: Dockerfile
args:
REVISION: "${REVISION}"
image: localhost/fastapitemplate_backend:${REVISION}
container_name: fastapitemplate_backend
restart: unless-stopped
environment:
- DATABASE_URL=postgresql+asyncpg://appuser:appsecret@db:5432/appdb
ports:
- "8080:8080"
healthcheck:
test:
[
"CMD",
"curl",
"--fail",
"--silent",
"--show-error",
"http://localhost:8080/api/ping",
]
interval: 10s
timeout: 5s
retries: 5
start_period: 15s
networks:
- net
depends_on:
db:
condition: service_healthy
volumes:
db_data:
networks:
net:
driver: bridge