-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.prod.yml
More file actions
103 lines (80 loc) · 1.93 KB
/
docker-compose.prod.yml
File metadata and controls
103 lines (80 loc) · 1.93 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
91
92
93
94
95
96
97
98
99
100
101
102
103
version: '3.10'
#----------------------
#----------------------
services:
ingress:
#----------------------
build:
context: ./ingress
dockerfile: Dockerfile
command: nginx -g "daemon off;"
ports:
- 80:80
depends_on:
frontend:
condition: service_started
backend:
condition: service_healthy
frontend:
#----------------------
build:
context: ./frontend
dockerfile: Dockerfile
command: nginx -g "daemon off;"
expose:
- 80
depends_on:
backend:
condition: service_healthy
backend:
#----------------------
build:
context: ./backend
dockerfile: Dockerfile
expose:
- 80
command: uvicorn rimsdash.main:app --host 0.0.0.0 --port 80
healthcheck:
test: curl --fail http://localhost:80/rims/api/v1/ready || exit 1
interval: 5s
timeout: 5s
retries: 3
start_period: 5s
depends_on:
db:
condition: service_healthy
db:
#----------------------
image: postgres:12
volumes:
- .rdb_postgres_data_prod:/var/lib/postgresql/data/
environment:
- POSTGRES_USER_FILE=/run/secrets/db_user
- POSTGRES_PASSWORD_FILE=/run/secrets/db_root_password
- POSTGRES_DB_FILE=/run/secrets/db_name
secrets:
- db_user
- db_name
- db_root_password
healthcheck:
test: ["CMD-SHELL", "pg_isready"]
#note: attempts to connect as root and throws error in log, seems to still work
interval: 10s
timeout: 5s
retries: 5
#----------------------
#----------------------
secrets:
db_user:
file: .secrets/db_user.txt
db_name:
file: .secrets/db_name.txt
db_root_password:
file: .secrets/db_root_password.txt
#----------------------
#----------------------
volumes:
rdb_postgres_data_prod:
driver: local
#----------------------
#----------------------