mirror of
https://github.com/frappe/frappe_docker.git
synced 2024-11-10 07:11:00 +00:00
118 lines
3.1 KiB
YAML
118 lines
3.1 KiB
YAML
services:
|
|
configurator:
|
|
image: frappe/frappe-worker:${FRAPPE_VERSION}
|
|
command: configure.py
|
|
environment:
|
|
DB_HOST: db
|
|
DB_PORT: 3306
|
|
REDIS_CACHE: redis:6379/0
|
|
REDIS_QUEUE: redis:6379/1
|
|
REDIS_SOCKETIO: redis:6379/2
|
|
SOCKETIO_PORT: 9000
|
|
volumes:
|
|
- sites:/home/frappe/frappe-bench/sites
|
|
depends_on:
|
|
db:
|
|
condition: service_healthy
|
|
|
|
backend:
|
|
image: frappe/frappe-worker:${FRAPPE_VERSION}
|
|
volumes:
|
|
- sites:/home/frappe/frappe-bench/sites
|
|
- assets:/home/frappe/frappe-bench/sites/assets
|
|
depends_on: &depends_on_configurator
|
|
configurator:
|
|
condition: service_completed_successfully
|
|
|
|
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
|
|
- --skip-innodb-read-only-compressed
|
|
environment:
|
|
MYSQL_ROOT_PASSWORD: ${DB_PASSWORD}
|
|
volumes:
|
|
- db-data:/var/lib/mysql
|
|
|
|
redis:
|
|
image: redis:6.2-alpine
|
|
volumes:
|
|
- redis-data:/data
|
|
|
|
frontend:
|
|
image: frappe/frappe-nginx:${FRAPPE_VERSION}
|
|
environment:
|
|
BACKEND: backend:8000
|
|
SOCKETIO: websocket:9000
|
|
FRAPPE_SITE_NAME_HEADER: $$host
|
|
volumes:
|
|
- sites:/usr/share/nginx/html/sites
|
|
- assets:/usr/share/nginx/html/assets
|
|
depends_on:
|
|
- backend
|
|
- websocket
|
|
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:.+}`)
|
|
|
|
proxy:
|
|
image: traefik:2.5
|
|
command:
|
|
- --providers.docker
|
|
- --providers.docker.exposedbydefault=false
|
|
- --entrypoints.web.address=:80
|
|
ports:
|
|
- 80:80
|
|
volumes:
|
|
- /var/run/docker.sock:/var/run/docker.sock:ro
|
|
userns_mode: host
|
|
|
|
websocket:
|
|
image: frappe/frappe-socketio:${FRAPPE_VERSION}
|
|
volumes:
|
|
- sites:/home/frappe/frappe-bench/sites
|
|
depends_on: *depends_on_configurator
|
|
|
|
queue-short:
|
|
image: frappe/frappe-worker:${FRAPPE_VERSION}
|
|
command: bench worker --queue short
|
|
volumes:
|
|
- sites:/home/frappe/frappe-bench/sites
|
|
depends_on: *depends_on_configurator
|
|
|
|
queue-default:
|
|
image: frappe/frappe-worker:${FRAPPE_VERSION}
|
|
command: bench worker --queue default
|
|
volumes:
|
|
- sites:/home/frappe/frappe-bench/sites
|
|
depends_on: *depends_on_configurator
|
|
|
|
queue-long:
|
|
image: frappe/frappe-worker:${FRAPPE_VERSION}
|
|
command: bench worker --queue long
|
|
volumes:
|
|
- sites:/home/frappe/frappe-bench/sites
|
|
depends_on: *depends_on_configurator
|
|
|
|
scheduler:
|
|
image: frappe/frappe-worker:${FRAPPE_VERSION}
|
|
command: bench schedule
|
|
volumes:
|
|
- sites:/home/frappe/frappe-bench/sites
|
|
depends_on: *depends_on_configurator
|
|
|
|
# ERPNext requires local assets access (Frappe does not)
|
|
volumes:
|
|
sites:
|
|
assets:
|
|
db-data:
|
|
redis-data:
|