Repository navigation
Expand file tree
/
Copy pathdocker-compose-swarm.yml
More file actions
118 lines (114 loc) · 3.83 KB
/
Copy pathdocker-compose-swarm.yml
File metadata and controls
118 lines (114 loc) · 3.83 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
version: "3.8"
services:
client:
image: 'ghcr.io/buzz-code/react-admin-nestjs-client:latest'
container_name: client
depends_on:
- server
deploy:
labels:
caddy: $DOMAIN_NAME
caddy.reverse_proxy: '{{upstreams 80}}'
caddy.reverse_proxy.health_uri: '/'
caddy.reverse_proxy.health_interval: 5s
caddy.reverse_proxy.health_timeout: 5s
caddy.reverse_proxy.lb_try_duration: 5s
caddy.reverse_proxy.lb_retries: 3
placement:
constraints:
- node.labels.codeserver != true
- node.labels.listenReport != true
update_config:
parallelism: 1
delay: 10s
order: start-first
rollback_config:
parallelism: 1
delay: 5s
restart_policy:
condition: on-failure
delay: 60s
max_attempts: 5
window: 120s
healthcheck:
test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://localhost:80/"]
interval: 30s
timeout: 10s
start_period: 60s
retries: 3
environment:
PORT: 80
REACT_APP_API_URL: 'https://api.$DOMAIN_NAME'
# ports:
# - '30003:80'
networks:
- private-network
- caddy
- elknet
server:
image: 'ghcr.io/buzz-code/react-admin-nestjs-server:latest'
container_name: server
deploy:
labels:
caddy: api.$DOMAIN_NAME
caddy.reverse_proxy: '{{upstreams 3000}}'
caddy.reverse_proxy.health_uri: '/health'
caddy.reverse_proxy.health_interval: 5s
caddy.reverse_proxy.health_timeout: 5s
caddy.reverse_proxy.transport: http
caddy.reverse_proxy.transport.keepalive: 30s
placement:
constraints:
- node.labels.codeserver != true
- node.labels.listenReport != true
update_config:
parallelism: 1
delay: 10s
order: start-first
rollback_config:
parallelism: 1
delay: 5s
restart_policy:
condition: on-failure
delay: 60s
max_attempts: 5
window: 120s
healthcheck:
test: ["CMD", "node", "-e", "require('http').get('http://localhost:3000/health', (r) => process.exit(r.statusCode === 200 ? 0 : 1))"]
interval: 30s
timeout: 10s
start_period: 60s
retries: 3
labels:
co.elastic.logs/enabled: 'true'
environment:
IP_ADDRESS: $IP_ADDRESS
DOMAIN_NAME: $DOMAIN_NAME
MYSQL_HOST: $MYSQL_HOST
MYSQL_USER: $MYSQL_USER
MYSQL_PASSWORD: $MYSQL_PASSWORD
MYSQL_DATABASE: $MYSQL_DATABASE
JWT_SECRET: $JWT_SECRET
ADMIN_USER: $ADMIN_USER
SMTP_USER: $SMTP_USER
SMTP_PASSWORD: $SMTP_PASSWORD
MAINTENANCE_MODE: $MAINTENANCE_MODE
MAINTENANCE_MESSAGE: $MAINTENANCE_MESSAGE
MAIL_WEBHOOK_SECRET: $MAIL_WEBHOOK_SECRET
YEMOT_LEGACY_ROUTE_DEADLINE: $YEMOT_LEGACY_ROUTE_DEADLINE
WORKER_ENABLED: ${WORKER_ENABLED:-true}
# ports:
# - '30004:3000'
networks:
- private-network
- backend-network
- caddy
- elknet
networks:
private-network:
caddy:
external: true
elknet:
external: true
backend-network:
external: true