forked from frappe/frappe_docker
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathexp.yaml
274 lines (271 loc) · 8.31 KB
/
exp.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
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
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
services:
backend:
depends_on:
configurator:
condition: service_completed_successfully
image: metalmon/frappe:latest
networks:
bench-network: null
mariadb-network: null
platform: linux/amd64
pull_policy: always
volumes:
- type: volume
source: sites
target: /home/frappe/frappe-bench/sites
volume: {}
configurator:
command:
- |
ls -1 apps > sites/apps.txt; bench set-config -g db_host $$DB_HOST; bench set-config -gp db_port $$DB_PORT; bench set-config -g redis_cache "redis://$$REDIS_CACHE"; bench set-config -g redis_queue "redis://$$REDIS_QUEUE"; bench set-config -g redis_socketio "redis://$$REDIS_QUEUE"; bench set-config -gp socketio_port $$SOCKETIO_PORT;
depends_on:
redis-cache:
condition: service_started
redis-queue:
condition: service_started
entrypoint:
- bash
- -c
environment:
DB_HOST: mariadb-database
DB_PORT: "3306"
REDIS_CACHE: redis-cache:6379
REDIS_QUEUE: redis-queue:6379
SOCKETIO_PORT: "9000"
image: metalmon/frappe:latest
networks:
bench-network: null
mariadb-network: null
platform: linux/amd64
pull_policy: always
volumes:
- type: volume
source: sites
target: /home/frappe/frappe-bench/sites
volume: {}
frontend:
command:
- nginx-entrypoint.sh
depends_on:
backend:
condition: service_started
websocket:
condition: service_started
environment:
BACKEND: backend:8000
CLIENT_MAX_BODY_SIZE: 50m
FRAPPE_SITE_NAME_HEADER: $$host
PROXY_READ_TIMEOUT: "120"
PROXY_SEND_TIMEOUT: "120"
PROXY_CONNECT_TIMEOUT: "120"
PROXY_WEBSOCKET_TIMEOUT: "120"
SOCKETIO: websocket:9000
UPSTREAM_REAL_IP_ADDRESS: 172.16.0.0/12
UPSTREAM_REAL_IP_HEADER: X-Forwarded-For
UPSTREAM_REAL_IP_RECURSIVE: "off"
NGINX_SOCKETIO_HEADERS: |
proxy_http_version 1.1;
proxy_set_header Upgrade $$http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header X-Frappe-Site-Name $$host;
proxy_set_header Origin $$scheme://$$host;
proxy_set_header Host $$host;
proxy_set_header X-Real-IP $$remote_addr;
proxy_set_header X-Forwarded-For $$proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $$scheme;
proxy_read_timeout 120;
proxy_connect_timeout 120;
proxy_send_timeout 120;
proxy_cache_bypass $$http_upgrade;
proxy_buffering off;
add_header 'Access-Control-Allow-Origin' '$$http_origin' always;
add_header 'Access-Control-Allow-Credentials' 'true' always;
add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS' always;
add_header 'Access-Control-Allow-Headers' 'DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Authorization' always;
if ($$request_method = 'OPTIONS') {
add_header 'Access-Control-Allow-Origin' '$$http_origin' always;
add_header 'Access-Control-Allow-Credentials' 'true' always;
add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS' always;
add_header 'Access-Control-Allow-Headers' 'DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Authorization' always;
add_header 'Access-Control-Max-Age' 1728000;
add_header 'Content-Type' 'text/plain charset=UTF-8';
add_header 'Content-Length' 0;
return 204;
}
image: metalmon/frappe:latest
labels:
traefik.docker.network: traefik-public
traefik.enable: "true"
# Main HTTP to HTTPS redirect
traefik.http.routers.exp-http.entrypoints: http
traefik.http.routers.exp-http.middlewares: https-redirect
traefik.http.routers.exp-http.rule: Host(`vatan.exp-verse.com`,`tatkardan.exp-verse.com`,`exp-verse.com`,`demo.frappecrm.ru`,`terra.frappecrm.ru`,`docs.frappecrm.ru`)
traefik.http.routers.exp-http.service: exp
# Main HTTPS router
traefik.http.routers.exp-https.entrypoints: https
traefik.http.routers.exp-https.rule: Host(`vatan.exp-verse.com`,`tatkardan.exp-verse.com`,`exp-verse.com`,`demo.frappecrm.ru`,`terra.frappecrm.ru`,`docs.frappecrm.ru`)
traefik.http.routers.exp-https.service: exp
traefik.http.routers.exp-https.tls: "true"
traefik.http.routers.exp-https.tls.certresolver: le
# Main service
traefik.http.services.exp.loadbalancer.server.port: "8080"
traefik.http.services.exp.loadbalancer.passHostHeader: "true"
networks:
- bench-network
- traefik-public
volumes:
- type: volume
source: sites
target: /home/frappe/frappe-bench/sites
volume: {}
queue-long:
command:
- bench
- worker
- --queue
- long,default,short
depends_on:
configurator:
condition: service_completed_successfully
image: metalmon/frappe:latest
networks:
bench-network: null
mariadb-network: null
platform: linux/amd64
pull_policy: always
volumes:
- type: volume
source: sites
target: /home/frappe/frappe-bench/sites
volume: {}
queue-short:
command:
- bench
- worker
- --queue
- short,default
depends_on:
configurator:
condition: service_completed_successfully
image: metalmon/frappe:latest
networks:
bench-network: null
mariadb-network: null
platform: linux/amd64
pull_policy: always
volumes:
- type: volume
source: sites
target: /home/frappe/frappe-bench/sites
volume: {}
redis-cache:
image: redis:6.2-alpine
command: ["redis-server", "/etc/redis.conf"]
networks:
bench-network: null
mariadb-network: null
volumes:
- type: volume
source: redis-cache-data
target: /data
volume: {}
- type: bind
source: /etc/redis.conf
target: /etc/redis.conf
read_only: true
redis-queue:
image: redis:6.2-alpine
command: ["redis-server", "/etc/redis.conf"]
networks:
bench-network: null
mariadb-network: null
volumes:
- type: volume
source: redis-queue-data
target: /data
volume: {}
- type: bind
source: /etc/redis.conf
target: /etc/redis.conf
read_only: true
scheduler:
command:
- bench
- schedule
depends_on:
configurator:
condition: service_completed_successfully
image: metalmon/frappe:latest
networks:
bench-network: null
mariadb-network: null
platform: linux/amd64
pull_policy: always
volumes:
- type: volume
source: sites
target: /home/frappe/frappe-bench/sites
volume: {}
websocket:
command:
- node
- /home/frappe/frappe-bench/apps/frappe/socketio.js
depends_on:
configurator:
condition: service_completed_successfully
redis-queue:
condition: service_started
environment:
REDIS_CACHE: "redis://redis-cache:6379"
REDIS_QUEUE: "redis://redis-queue:6379"
REDIS_SOCKETIO: "redis://redis-queue:6379"
SOCKETIO_PORT: "9000"
SOCKETIO_PING_INTERVAL: "25000"
SOCKETIO_PING_TIMEOUT: "5000"
SOCKETIO_MAX_HTTP_BUFFER_SIZE: "1000000"
SOCKETIO_TRANSPORTS: "['polling', 'websocket']"
SOCKETIO_CORS_ALLOWED_ORIGINS: "*"
image: metalmon/frappe:latest
networks:
- bench-network
platform: linux/amd64
pull_policy: always
volumes:
- type: volume
source: sites
target: /home/frappe/frappe-bench/sites
volume: {}
networks:
bench-network:
name: exp
mariadb-network:
name: mariadb-network
external: true
traefik-public:
name: traefik-public
external: true
volumes:
redis-cache-data:
name: exp_redis-cache-data
external: false
redis-queue-data:
name: exp_redis-queue-data
external: false
sites:
name: exp_sites
external: false
x-backend-defaults:
depends_on:
configurator:
condition: service_completed_successfully
image: metalmon/frappe:latest
pull_policy: always
volumes:
- sites:/home/frappe/frappe-bench/sites
x-customizable-image:
image: metalmon/frappe:latest
pull_policy: always
x-depends-on-configurator:
depends_on:
configurator:
condition: service_completed_successfully