-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yaml
More file actions
191 lines (191 loc) · 4.59 KB
/
docker-compose.yaml
File metadata and controls
191 lines (191 loc) · 4.59 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
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
name: sort
networks:
default:
name: sort-network
services:
postgres:
container_name: postgres
environment:
- POSTGRES_DB=${POSTGRES_DB:-sort_xyz}
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD:-dbadmin}
- POSTGRES_USER=${POSTGRES_USER:-root}
image: sort-postgres
restart: always
ports:
- 5432:5432
volumes:
- ./packages/sort-db:/docker-entrypoint-initdb.d
healthcheck:
test: ["CMD", "sh", "-c", "/scripts/health-probe.sh"]
interval: 30s
timeout: 5s
retries: 3
start_period: 10s
start_interval: 5s
logging:
driver: "local"
options:
max-size: "10m"
max-file: "3"
sort-api:
container_name: sort-api
environment:
- POSTGRES_DB=${POSTGRES_DB:-sort_xyz}
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD:-dbadmin}
- POSTGRES_USER=${POSTGRES_USER:-root}
- POSTGRES_HOST=local-postgres-db:5432
- NODE_ENV=production
image: sort-api
deploy:
restart_policy:
condition: on-failure
delay: 30s
max_attempts: 3
resources:
limits:
memory: 2048M
reservations:
memory: 512M
depends_on:
postgres:
condition: service_healthy
required: true
restart: true
env_file:
- path: ./scripts/sort-api/env.onprem
required: true
healthcheck:
test: wget --no-verbose --tries=1 --spider http://0.0.0.0:8080/health || exit 1
interval: 30s
timeout: 5s
retries: 3
start_period: 10s
start_interval: 5s
ports:
- 8080:8080
links:
- postgres:local-postgres-db
post_start:
- command: pnpm db:create-test-user
working_dir: /prod/api
user: root
logging:
driver: "local"
options:
max-size: "10m"
max-file: "3"
sort-worker:
container_name: sort-worker
environment:
- HEALTH_SERVICE_PORT=8081
- POSTGRES_DB=${POSTGRES_DB:-sort_xyz}
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD:-dbadmin}
- POSTGRES_USER=${POSTGRES_USER:-root}
- POSTGRES_HOST=local-postgres-db:5432
- NODE_ENV=production
env_file:
- path: ./scripts/sort-worker/env.onprem
required: true
image: sort-worker
deploy:
restart_policy:
condition: on-failure
delay: 30s
max_attempts: 3
resources:
limits:
memory: 800M
reservations:
memory: 400M
depends_on:
sort-api:
condition: service_healthy
required: true
restart: true
ports:
- 8081:8081
links:
- postgres:local-postgres-db
healthcheck:
test: wget --no-verbose --tries=1 --spider http://0.0.0.0:8081/ || exit 1
interval: 30s
timeout: 5s
retries: 3
start_period: 5s
start_interval: 5s
security_opt:
- no-new-privileges:true
logging:
driver: "local"
options:
max-size: "10m"
max-file: "3"
sort-web:
container_name: sort-web
image: sort-web
ports:
- "3000:3000"
env_file:
- path: ./scripts/sort-web/env.onprem
required: true
environment:
SORT_WEB_API_BASE_URL: ${SORT_WEB_API_BASE_URL:-http://sort-api:8080}
NODE_ENV: production
HOST: 0.0.0.0
PORT: 3000
ON_PREM_AUTH: ${ON_PREM_AUTH:-1}
deploy:
resources:
limits:
memory: 512M
reservations:
memory: 256M
healthcheck:
test: wget --no-verbose --tries=1 --spider http://0.0.0.0:3000/health || exit 1
interval: 30s
timeout: 5s
retries: 3
start_period: 10s
start_interval: 5s
logging:
driver: "local"
options:
max-size: "10m"
max-file: "3"
security_opt:
- no-new-privileges:true
depends_on:
sort-worker:
condition: service_healthy
required: true
restart: true
sort-api:
condition: service_healthy
required: true
restart: true
sort-web-nginx-proxy:
container_name: sort-web-nginx-proxy
image: nginx:1.27.3
ports:
- "80:80"
- "443:443"
volumes:
- ./scripts/nginx-proxy/nginx.conf:/etc/nginx/nginx.conf:ro
- ./scripts/nginx-proxy/certs:/etc/nginx/certs:ro
restart: unless-stopped
deploy:
resources:
limits:
memory: 512M
reservations:
memory: 256M
logging:
driver: "local"
options:
max-size: "10m"
max-file: "3"
depends_on:
sort-web:
condition: service_healthy
required: true
restart: true