2021-12-17 08:26:38 +00:00
|
|
|
x-depends-on-configurator: &depends_on_configurator
|
|
|
|
depends_on:
|
|
|
|
configurator:
|
|
|
|
condition: service_completed_successfully
|
|
|
|
|
|
|
|
x-backend-defaults: &backend_defaults
|
|
|
|
<<: *depends_on_configurator
|
|
|
|
image: frappe/frappe-worker:${FRAPPE_VERSION:?No Frappe version set}
|
|
|
|
volumes:
|
|
|
|
- sites:/home/frappe/frappe-bench/sites
|
|
|
|
|
2020-06-12 16:49:37 +00:00
|
|
|
services:
|
2021-12-15 09:41:35 +00:00
|
|
|
configurator:
|
2021-12-17 08:26:38 +00:00
|
|
|
<<: *backend_defaults
|
2021-12-15 10:37:06 +00:00
|
|
|
command: configure.py
|
2020-06-12 16:49:37 +00:00
|
|
|
environment:
|
2021-12-13 16:39:48 +00:00
|
|
|
DB_HOST: db
|
|
|
|
DB_PORT: 3306
|
|
|
|
REDIS_CACHE: redis:6379/0
|
|
|
|
REDIS_QUEUE: redis:6379/1
|
|
|
|
REDIS_SOCKETIO: redis:6379/2
|
|
|
|
SOCKETIO_PORT: 9000
|
|
|
|
depends_on:
|
|
|
|
db:
|
|
|
|
condition: service_healthy
|
2020-06-12 16:49:37 +00:00
|
|
|
|
2021-12-15 09:41:35 +00:00
|
|
|
backend:
|
2021-12-17 08:26:38 +00:00
|
|
|
<<: *backend_defaults
|
2021-12-15 09:41:35 +00:00
|
|
|
volumes:
|
|
|
|
- sites:/home/frappe/frappe-bench/sites
|
|
|
|
- assets:/home/frappe/frappe-bench/sites/assets
|
|
|
|
|
2021-12-13 16:39:48 +00:00
|
|
|
db:
|
|
|
|
image: mariadb:10.6
|
|
|
|
healthcheck:
|
|
|
|
test: mysqladmin ping -h localhost --password=${DB_PASSWORD}
|
|
|
|
interval: 1s
|
|
|
|
retries: 15
|
|
|
|
command:
|
|
|
|
- --character-set-server=utf8mb4
|
|
|
|
- --collation-server=utf8mb4_unicode_ci
|
|
|
|
- --skip-character-set-client-handshake
|
2021-12-17 09:44:19 +00:00
|
|
|
- --skip-innodb-read-only-compressed # Temporary fix for MariaDB 10.6
|
2020-06-12 16:49:37 +00:00
|
|
|
environment:
|
2021-12-17 08:26:38 +00:00
|
|
|
MYSQL_ROOT_PASSWORD: ${DB_PASSWORD:?No db password set}
|
2020-06-12 16:49:37 +00:00
|
|
|
volumes:
|
2021-12-15 09:41:35 +00:00
|
|
|
- db-data:/var/lib/mysql
|
2020-06-12 16:49:37 +00:00
|
|
|
|
2021-12-13 16:39:48 +00:00
|
|
|
redis:
|
|
|
|
image: redis:6.2-alpine
|
2020-06-12 16:49:37 +00:00
|
|
|
volumes:
|
2021-12-15 09:41:35 +00:00
|
|
|
- redis-data:/data
|
2020-06-12 16:49:37 +00:00
|
|
|
|
2021-12-13 16:39:48 +00:00
|
|
|
frontend:
|
|
|
|
image: frappe/frappe-nginx:${FRAPPE_VERSION}
|
2020-06-12 16:49:37 +00:00
|
|
|
environment:
|
2021-12-13 16:39:48 +00:00
|
|
|
BACKEND: backend:8000
|
|
|
|
SOCKETIO: websocket:9000
|
|
|
|
FRAPPE_SITE_NAME_HEADER: $$host
|
2020-06-12 16:49:37 +00:00
|
|
|
volumes:
|
2021-12-13 16:39:48 +00:00
|
|
|
- sites:/usr/share/nginx/html/sites
|
2021-12-15 06:14:44 +00:00
|
|
|
- assets:/usr/share/nginx/html/assets
|
2021-12-15 09:41:35 +00:00
|
|
|
depends_on:
|
|
|
|
- backend
|
|
|
|
- websocket
|
2021-12-13 16:39:48 +00:00
|
|
|
labels:
|
|
|
|
- traefik.enable=true
|
|
|
|
- traefik.http.services.frontend.loadbalancer.server.port=80
|
|
|
|
- traefik.http.routers.frontend-http.entrypoints=web
|
|
|
|
- traefik.http.routers.frontend-http.rule=HostRegexp(`{any:.+}`)
|
2020-06-12 16:49:37 +00:00
|
|
|
|
2021-12-13 16:39:48 +00:00
|
|
|
proxy:
|
|
|
|
image: traefik:2.5
|
|
|
|
command:
|
|
|
|
- --providers.docker
|
|
|
|
- --providers.docker.exposedbydefault=false
|
|
|
|
- --entrypoints.web.address=:80
|
|
|
|
ports:
|
|
|
|
- 80:80
|
2020-06-12 16:49:37 +00:00
|
|
|
volumes:
|
2021-12-13 16:39:48 +00:00
|
|
|
- /var/run/docker.sock:/var/run/docker.sock:ro
|
|
|
|
userns_mode: host
|
2020-06-12 16:49:37 +00:00
|
|
|
|
2021-12-13 16:39:48 +00:00
|
|
|
websocket:
|
2021-12-17 08:26:38 +00:00
|
|
|
<<: *depends_on_configurator
|
2021-12-13 16:39:48 +00:00
|
|
|
image: frappe/frappe-socketio:${FRAPPE_VERSION}
|
2020-06-12 16:49:37 +00:00
|
|
|
volumes:
|
2021-12-13 16:39:48 +00:00
|
|
|
- sites:/home/frappe/frappe-bench/sites
|
2020-06-12 16:49:37 +00:00
|
|
|
|
2021-12-13 16:39:48 +00:00
|
|
|
queue-short:
|
2021-12-17 08:26:38 +00:00
|
|
|
<<: *backend_defaults
|
2021-12-13 16:39:48 +00:00
|
|
|
command: bench worker --queue short
|
2020-06-12 16:49:37 +00:00
|
|
|
|
2021-12-13 16:39:48 +00:00
|
|
|
queue-default:
|
2021-12-17 08:26:38 +00:00
|
|
|
<<: *backend_defaults
|
2021-12-13 16:39:48 +00:00
|
|
|
command: bench worker --queue default
|
2020-06-12 16:49:37 +00:00
|
|
|
|
2021-12-13 16:39:48 +00:00
|
|
|
queue-long:
|
2021-12-17 08:26:38 +00:00
|
|
|
<<: *backend_defaults
|
2021-12-13 16:39:48 +00:00
|
|
|
command: bench worker --queue long
|
2020-06-12 16:49:37 +00:00
|
|
|
|
2021-12-13 16:39:48 +00:00
|
|
|
scheduler:
|
2021-12-17 08:26:38 +00:00
|
|
|
<<: *backend_defaults
|
2021-12-13 16:39:48 +00:00
|
|
|
command: bench schedule
|
2020-06-12 16:49:37 +00:00
|
|
|
|
2021-12-15 06:14:44 +00:00
|
|
|
# ERPNext requires local assets access (Frappe does not)
|
2020-06-12 16:49:37 +00:00
|
|
|
volumes:
|
2021-12-13 16:39:48 +00:00
|
|
|
sites:
|
2021-12-15 06:14:44 +00:00
|
|
|
assets:
|
2021-12-15 09:41:35 +00:00
|
|
|
db-data:
|
|
|
|
redis-data:
|