generated from ouslan/project-template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose-prod.yaml
69 lines (63 loc) · 1.42 KB
/
docker-compose-prod.yaml
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
services:
watchtower:
image: containrrr/watchtower
container_name: watchtower
command:
- "--label-enable"
- "--interval"
- "10"
- "--rolling-restart"
- "--cleanup"
volumes:
- /var/run/docker.sock:/var/run/docker.sock
database:
image: postgres:17
container_name: api_database
restart: always
secrets:
- db-password
ports:
- 5551:5432
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD_FILE: /run/secrets/db-password
POSTGRES_DB: postgres
volumes:
- database_volume:/var/lib/postgresql/data
networks:
- api_network
healthcheck:
test: ["CMD", "pg_isready", "-U", "postgres", "-d", "postgres"]
interval: 5s
timeout: 3s
retries: 5
api:
container_name: FastAPI
image: ghcr.io/econlabs/econlabs/jp-api:stagging
labels:
- "com.centurylinklabs.watchtower.enable=true"
restart: always
secrets:
- db-password
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD_FILE: /run/secrets/db-password
POSTGRES_DB: postgres
POSTGRES_PORT: 5551
volumes:
- data_folder:/app/data
ports:
- 5051:8000
networks:
- api_network
depends_on:
database:
condition: service_healthy
networks:
api_network:
volumes:
database_volume:
data_folder:
secrets:
db-password:
file: ~/db/password.txt