mirror of
https://github.com/frappe/frappe_docker.git
synced 2025-01-24 23:58:27 +00:00
Update compose
This commit is contained in:
parent
5408c586e8
commit
eaefb4817f
257
compose.yml
257
compose.yml
@ -1,180 +1,111 @@
|
|||||||
version: "3"
|
version: "3.9"
|
||||||
|
|
||||||
services:
|
services:
|
||||||
traefik:
|
backend:
|
||||||
image: "traefik:v2.2"
|
image: frappe/frappe-worker:${FRAPPE_VERSION}
|
||||||
command:
|
|
||||||
- "--providers.docker=true"
|
|
||||||
- "--providers.docker.exposedbydefault=false"
|
|
||||||
- "--entrypoints.web.address=:80"
|
|
||||||
- "--entrypoints.websecure.address=:443"
|
|
||||||
- "--certificatesresolvers.myresolver.acme.httpchallenge=true"
|
|
||||||
- "--certificatesresolvers.myresolver.acme.httpchallenge.entrypoint=web"
|
|
||||||
- "--certificatesresolvers.myresolver.acme.email=${LETSENCRYPT_EMAIL}"
|
|
||||||
- "--certificatesresolvers.myresolver.acme.storage=/letsencrypt/acme.json"
|
|
||||||
labels:
|
|
||||||
# enable traefik
|
|
||||||
- "traefik.enable=true"
|
|
||||||
# global redirect to https for production only
|
|
||||||
- "${HTTPS_REDIRECT_RULE_LABEL}"
|
|
||||||
- "${HTTPS_REDIRECT_ENTRYPOINT_LABEL}"
|
|
||||||
- "${HTTPS_REDIRECT_MIDDLEWARE_LABEL}"
|
|
||||||
# middleware redirect for production only
|
|
||||||
- "${HTTPS_USE_REDIRECT_MIDDLEWARE_LABEL}"
|
|
||||||
ports:
|
|
||||||
- "80:80"
|
|
||||||
- "443:443"
|
|
||||||
volumes:
|
|
||||||
- cert-vol:/letsencrypt
|
|
||||||
- /var/run/docker.sock:/var/run/docker.sock:ro
|
|
||||||
userns_mode: "host"
|
|
||||||
|
|
||||||
erpnext-nginx:
|
|
||||||
image: frappe/erpnext-nginx:${ERPNEXT_VERSION}
|
|
||||||
restart: on-failure
|
|
||||||
environment:
|
environment:
|
||||||
- FRAPPE_PY=erpnext-python
|
DB_HOST: db
|
||||||
- FRAPPE_PY_PORT=8000
|
DB_PORT: 3306
|
||||||
- FRAPPE_SOCKETIO=frappe-socketio
|
REDIS_CACHE: redis:6379/0
|
||||||
- SOCKETIO_PORT=9000
|
REDIS_QUEUE: redis:6379/1
|
||||||
- SKIP_NGINX_TEMPLATE_GENERATION=${SKIP_NGINX_TEMPLATE_GENERATION}
|
REDIS_SOCKETIO: redis:6379/2
|
||||||
labels:
|
SOCKETIO_PORT: 9000
|
||||||
- "traefik.enable=true"
|
|
||||||
- "traefik.http.routers.erpnext-nginx.rule=Host(${SITES})"
|
|
||||||
- "${ENTRYPOINT_LABEL}"
|
|
||||||
- "${CERT_RESOLVER_LABEL}"
|
|
||||||
- "traefik.http.services.erpnext-nginx.loadbalancer.server.port=8080"
|
|
||||||
volumes:
|
volumes:
|
||||||
- sites-vol:/var/www/html/sites:rw
|
- sites:/home/frappe/frappe-bench/sites
|
||||||
- assets-vol:/assets:rw
|
|
||||||
|
|
||||||
erpnext-python:
|
|
||||||
image: frappe/erpnext-worker:${ERPNEXT_VERSION}
|
|
||||||
restart: on-failure
|
|
||||||
environment:
|
|
||||||
- MARIADB_HOST=${MARIADB_HOST}
|
|
||||||
- REDIS_CACHE=redis-cache:6379
|
|
||||||
- REDIS_QUEUE=redis-queue:6379
|
|
||||||
- REDIS_SOCKETIO=redis-socketio:6379
|
|
||||||
- SOCKETIO_PORT=9000
|
|
||||||
- AUTO_MIGRATE=1
|
|
||||||
- WORKER_CLASS=${WORKER_CLASS}
|
|
||||||
volumes:
|
|
||||||
- sites-vol:/home/frappe/frappe-bench/sites:rw
|
|
||||||
- assets-vol:/home/frappe/frappe-bench/sites/assets:rw
|
|
||||||
|
|
||||||
frappe-socketio:
|
|
||||||
image: frappe/frappe-socketio:${FRAPPE_VERSION}
|
|
||||||
restart: on-failure
|
|
||||||
depends_on:
|
depends_on:
|
||||||
- redis-socketio
|
db:
|
||||||
volumes:
|
condition: service_healthy
|
||||||
- sites-vol:/home/frappe/frappe-bench/sites:rw
|
|
||||||
- logs-vol:/home/frappe/frappe-bench/logs:rw
|
|
||||||
|
|
||||||
erpnext-worker-default:
|
db:
|
||||||
image: frappe/erpnext-worker:${ERPNEXT_VERSION}
|
|
||||||
restart: on-failure
|
|
||||||
command: worker
|
|
||||||
depends_on:
|
|
||||||
- redis-queue
|
|
||||||
- redis-cache
|
|
||||||
volumes:
|
|
||||||
- sites-vol:/home/frappe/frappe-bench/sites:rw
|
|
||||||
- logs-vol:/home/frappe/frappe-bench/logs:rw
|
|
||||||
|
|
||||||
erpnext-worker-short:
|
|
||||||
image: frappe/erpnext-worker:${ERPNEXT_VERSION}
|
|
||||||
restart: on-failure
|
|
||||||
command: worker
|
|
||||||
environment:
|
|
||||||
- WORKER_TYPE=short
|
|
||||||
depends_on:
|
|
||||||
- redis-queue
|
|
||||||
- redis-cache
|
|
||||||
volumes:
|
|
||||||
- sites-vol:/home/frappe/frappe-bench/sites:rw
|
|
||||||
- logs-vol:/home/frappe/frappe-bench/logs:rw
|
|
||||||
|
|
||||||
erpnext-worker-long:
|
|
||||||
image: frappe/erpnext-worker:${ERPNEXT_VERSION}
|
|
||||||
restart: on-failure
|
|
||||||
command: worker
|
|
||||||
environment:
|
|
||||||
- WORKER_TYPE=long
|
|
||||||
depends_on:
|
|
||||||
- redis-queue
|
|
||||||
- redis-cache
|
|
||||||
volumes:
|
|
||||||
- sites-vol:/home/frappe/frappe-bench/sites:rw
|
|
||||||
|
|
||||||
erpnext-schedule:
|
|
||||||
image: frappe/erpnext-worker:${ERPNEXT_VERSION}
|
|
||||||
restart: on-failure
|
|
||||||
command: schedule
|
|
||||||
depends_on:
|
|
||||||
- redis-queue
|
|
||||||
- redis-cache
|
|
||||||
volumes:
|
|
||||||
- sites-vol:/home/frappe/frappe-bench/sites:rw
|
|
||||||
- logs-vol:/home/frappe/frappe-bench/logs:rw
|
|
||||||
|
|
||||||
redis-cache:
|
|
||||||
image: redis:latest
|
|
||||||
restart: on-failure
|
|
||||||
volumes:
|
|
||||||
- redis-cache-vol:/data
|
|
||||||
|
|
||||||
redis-queue:
|
|
||||||
image: redis:latest
|
|
||||||
restart: on-failure
|
|
||||||
volumes:
|
|
||||||
- redis-queue-vol:/data
|
|
||||||
|
|
||||||
redis-socketio:
|
|
||||||
image: redis:latest
|
|
||||||
restart: on-failure
|
|
||||||
volumes:
|
|
||||||
- redis-socketio-vol:/data
|
|
||||||
|
|
||||||
mariadb:
|
|
||||||
image: mariadb:10.6
|
image: mariadb:10.6
|
||||||
restart: on-failure
|
healthcheck:
|
||||||
|
test: mysqladmin ping -h localhost --password=${DB_PASSWORD}
|
||||||
|
interval: 1s
|
||||||
|
retries: 15
|
||||||
command:
|
command:
|
||||||
- --character-set-server=utf8mb4
|
- --character-set-server=utf8mb4
|
||||||
- --collation-server=utf8mb4_unicode_ci
|
- --collation-server=utf8mb4_unicode_ci
|
||||||
- --skip-character-set-client-handshake
|
- --skip-character-set-client-handshake
|
||||||
- --skip-innodb-read-only-compressed # Temporary fix for MariaDB 10.6
|
- --skip-innodb-read-only-compressed
|
||||||
environment:
|
environment:
|
||||||
- MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD}
|
MYSQL_ROOT_PASSWORD: ${DB_PASSWORD}
|
||||||
# Sometimes db initialization takes longer than 10 seconds and site-creator goes away.
|
|
||||||
# Frappe doesn't use CONVERT_TZ() function that requires time zone info, so we can just skip it.
|
|
||||||
- MYSQL_INITDB_SKIP_TZINFO=1
|
|
||||||
volumes:
|
volumes:
|
||||||
- mariadb-vol:/var/lib/mysql
|
- db:/var/lib/mysql
|
||||||
|
|
||||||
site-creator:
|
redis:
|
||||||
image: frappe/erpnext-worker:${ERPNEXT_VERSION}
|
image: redis:6.2-alpine
|
||||||
restart: "no"
|
|
||||||
command: new
|
|
||||||
depends_on:
|
|
||||||
- erpnext-python
|
|
||||||
environment:
|
|
||||||
- SITE_NAME=${SITE_NAME}
|
|
||||||
- DB_ROOT_USER=${DB_ROOT_USER}
|
|
||||||
- MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD}
|
|
||||||
- ADMIN_PASSWORD=${ADMIN_PASSWORD}
|
|
||||||
- INSTALL_APPS=${INSTALL_APPS}
|
|
||||||
volumes:
|
volumes:
|
||||||
- sites-vol:/home/frappe/frappe-bench/sites:rw
|
- redis:/data
|
||||||
- logs-vol:/home/frappe/frappe-bench/logs:rw
|
|
||||||
|
frontend:
|
||||||
|
image: frappe/frappe-nginx:${FRAPPE_VERSION}
|
||||||
|
depends_on:
|
||||||
|
- backend
|
||||||
|
- websocket
|
||||||
|
environment:
|
||||||
|
BACKEND: backend:8000
|
||||||
|
SOCKETIO: websocket:9000
|
||||||
|
FRAPPE_SITE_NAME_HEADER: $$host
|
||||||
|
volumes:
|
||||||
|
- sites:/usr/share/nginx/html/sites
|
||||||
|
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}
|
||||||
|
depends_on:
|
||||||
|
- backend
|
||||||
|
volumes:
|
||||||
|
- sites:/home/frappe/frappe-bench/sites
|
||||||
|
|
||||||
|
queue-short:
|
||||||
|
image: frappe/frappe-worker:${FRAPPE_VERSION}
|
||||||
|
command: bench worker --queue short
|
||||||
|
volumes:
|
||||||
|
- sites:/home/frappe/frappe-bench/sites
|
||||||
|
depends_on:
|
||||||
|
- backend
|
||||||
|
|
||||||
|
queue-default:
|
||||||
|
image: frappe/frappe-worker:${FRAPPE_VERSION}
|
||||||
|
command: bench worker --queue default
|
||||||
|
volumes:
|
||||||
|
- sites:/home/frappe/frappe-bench/sites
|
||||||
|
depends_on:
|
||||||
|
- backend
|
||||||
|
|
||||||
|
queue-long:
|
||||||
|
image: frappe/frappe-worker:${FRAPPE_VERSION}
|
||||||
|
command: bench worker --queue long
|
||||||
|
volumes:
|
||||||
|
- sites:/home/frappe/frappe-bench/sites
|
||||||
|
depends_on:
|
||||||
|
- backend
|
||||||
|
|
||||||
|
scheduler:
|
||||||
|
image: frappe/frappe-worker:${FRAPPE_VERSION}
|
||||||
|
command: bench schedule
|
||||||
|
volumes:
|
||||||
|
- sites:/home/frappe/frappe-bench/sites
|
||||||
|
depends_on:
|
||||||
|
- backend
|
||||||
|
|
||||||
volumes:
|
volumes:
|
||||||
mariadb-vol:
|
sites:
|
||||||
redis-cache-vol:
|
db:
|
||||||
redis-queue-vol:
|
redis:
|
||||||
redis-socketio-vol:
|
|
||||||
assets-vol:
|
|
||||||
sites-vol:
|
|
||||||
cert-vol:
|
|
||||||
logs-vol:
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user