-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
131 lines (116 loc) · 4.35 KB
/
docker-compose.yml
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
x-frappe-service-defaults: &frappe_service_defaults
image: frappe/bench:latest
volumes:
- ./frappe-bench:/home/frappe/frappe-bench
x-frappe-service-depends: &frappe_service_depends
depends_on:
- mariadb
- redis-cache
- redis-queue
x-wait-for-configurator: &wait_for_configurator
entrypoint:
- /bin/bash
- -c
- |
if [ ! -f /home/frappe/frappe-bench/.configured ]; then
echo "Waiting for configuration to be completed...";
while [ ! -f /home/frappe/frappe-bench/.configured ]; do sleep 60; done;
fi
echo "Configuration detected, proceeding with the following command:" &&
echo "$@" &&
exec "$@"
restart: always
services:
cupsd:
image: drpsychick/airprint-bridge:latest
restart: always
environment:
CUPS_USER_ADMIN: ${CUPS_USER_ADMIN}
CUPS_USER_PASSWORD: ${CUPS_USER_PASSWORD}
ports:
- "8631:631"
volumes:
- ./cupsd.conf:/etc/cups/cupsd.conf
- ./printers.conf:/etc/cups/printers.conf
mariadb:
image: mariadb:latest
restart: always
command:
- --character-set-server=utf8mb4
- --collation-server=utf8mb4_unicode_ci
- --skip-character-set-client-handshake
environment:
MYSQL_ROOT_PASSWORD: ${DB_ROOT_PASSWORD}
volumes:
- ./mariadb-data:/var/lib/mysql
redis-cache:
image: redis:alpine
restart: always
redis-queue:
image: redis:alpine
restart: always
configurator:
<<: *frappe_service_defaults
entrypoint:
- bash
- -c
command:
- >
if [ ! -f /home/frappe/frappe-bench/.configured ]; then
sudo chown -R frappe:frappe /home/frappe/frappe-bench &&
rm -rf /home/frappe/frappe-bench/* &&
bench init --skip-redis-config-generation --version=${FRAPPE_VERSION} --ignore-exist /home/frappe/frappe-bench &&
bench set-config -g db_type mariadb &&
bench set-config -g db_host mariadb &&
bench set-config -g redis_cache redis://redis-cache:6379 &&
bench set-config -g redis_queue redis://redis-queue:6379 &&
bench set-config -g redis_socketio redis://redis-queue:6379 &&
bench set-config -gp socketio_port 9000 &&
bench set-config -gp developer_mode 1 &&
bench new-site --no-mariadb-socket --db-root-password=${DB_ROOT_PASSWORD} --admin-password=${SITE_PASSWORD} --set-default ${FRAPPE_SITE_NAME_HEADER} &&
bench enable-scheduler &&
touch /home/frappe/frappe-bench/.configured
else
echo "Configuration already completed."
fi
working_dir: /home/frappe/frappe-bench
backend:
<<: [*frappe_service_defaults, *frappe_service_depends, *wait_for_configurator]
command: exec /home/frappe/frappe-bench/env/bin/gunicorn -b 0.0.0.0:8000 -w 4 --max-requests 1200 --max-requests-jitter 50 -t 120 frappe.app:application --preload
environment:
- GUNICORN_CMD_ARGS=--access-logfile /home/frappe/frappe-bench/logs/web.log --error-logfile /home/frappe/frappe-bench/logs/web.error.log
working_dir: /home/frappe/frappe-bench/sites
websocket:
<<: [*frappe_service_defaults, *frappe_service_depends, *wait_for_configurator]
command: exec node apps/frappe/socketio.js
working_dir: /home/frappe/frappe-bench
watch:
<<: [*frappe_service_defaults, *frappe_service_depends, *wait_for_configurator]
command: exec bench watch
working_dir: /home/frappe/frappe-bench
schedule:
<<: [*frappe_service_defaults, *frappe_service_depends, *wait_for_configurator]
command: exec bench schedule
working_dir: /home/frappe/frappe-bench
worker_short:
<<: [*frappe_service_defaults, *frappe_service_depends, *wait_for_configurator]
command: exec bench worker --queue short
working_dir: /home/frappe/frappe-bench
worker_long:
<<: [*frappe_service_defaults, *frappe_service_depends, *wait_for_configurator]
command: exec bench worker --queue long
working_dir: /home/frappe/frappe-bench
worker_default:
<<: [*frappe_service_defaults, *frappe_service_depends, *wait_for_configurator]
command: exec bench worker --queue default
working_dir: /home/frappe/frappe-bench
web:
image: caddy:2-alpine
ports:
- "8080:80"
volumes:
- ./Caddyfile:/etc/caddy/Caddyfile
- ./frappe-bench:/home/frappe/frappe-bench
depends_on:
- backend
- websocket