mirror of
https://github.com/frappe/frappe_docker.git
synced 2024-11-09 23:00:56 +00:00
Take advantage of yaml lang: add defaults in compose file. Also require env vars
This commit is contained in:
parent
d15ef8d4e4
commit
e75cf62255
44
compose.yaml
44
compose.yaml
@ -1,6 +1,17 @@
|
||||
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
|
||||
|
||||
services:
|
||||
configurator:
|
||||
image: frappe/frappe-worker:${FRAPPE_VERSION}
|
||||
<<: *backend_defaults
|
||||
command: configure.py
|
||||
environment:
|
||||
DB_HOST: db
|
||||
@ -9,20 +20,15 @@ services:
|
||||
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}
|
||||
<<: *backend_defaults
|
||||
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
|
||||
@ -36,7 +42,7 @@ services:
|
||||
- --skip-character-set-client-handshake
|
||||
- --skip-innodb-read-only-compressed
|
||||
environment:
|
||||
MYSQL_ROOT_PASSWORD: ${DB_PASSWORD}
|
||||
MYSQL_ROOT_PASSWORD: ${DB_PASSWORD:?No db password set}
|
||||
volumes:
|
||||
- db-data:/var/lib/mysql
|
||||
|
||||
@ -76,38 +82,26 @@ services:
|
||||
userns_mode: host
|
||||
|
||||
websocket:
|
||||
<<: *depends_on_configurator
|
||||
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}
|
||||
<<: *backend_defaults
|
||||
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}
|
||||
<<: *backend_defaults
|
||||
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}
|
||||
<<: *backend_defaults
|
||||
command: bench worker --queue long
|
||||
volumes:
|
||||
- sites:/home/frappe/frappe-bench/sites
|
||||
depends_on: *depends_on_configurator
|
||||
|
||||
scheduler:
|
||||
image: frappe/frappe-worker:${FRAPPE_VERSION}
|
||||
<<: *backend_defaults
|
||||
command: bench schedule
|
||||
volumes:
|
||||
- sites:/home/frappe/frappe-bench/sites
|
||||
depends_on: *depends_on_configurator
|
||||
|
||||
# ERPNext requires local assets access (Frappe does not)
|
||||
volumes:
|
||||
|
@ -1,21 +1,24 @@
|
||||
x-erpnext-backend-image: &erpnext_backend_image
|
||||
image: frappe/erpnext-worker:${ERPNEXT_VERSION:?No ERPNext version set}
|
||||
|
||||
services:
|
||||
configurator:
|
||||
image: frappe/erpnext-worker:${ERPNEXT_VERSION}
|
||||
<<: *erpnext_backend_image
|
||||
|
||||
backend:
|
||||
image: frappe/erpnext-worker:${ERPNEXT_VERSION}
|
||||
<<: *erpnext_backend_image
|
||||
|
||||
frontend:
|
||||
image: frappe/erpnext-nginx:${ERPNEXT_VERSION}
|
||||
|
||||
queue-short:
|
||||
image: frappe/erpnext-worker:${ERPNEXT_VERSION}
|
||||
<<: *erpnext_backend_image
|
||||
|
||||
queue-default:
|
||||
image: frappe/erpnext-worker:${ERPNEXT_VERSION}
|
||||
<<: *erpnext_backend_image
|
||||
|
||||
queue-long:
|
||||
image: frappe/erpnext-worker:${ERPNEXT_VERSION}
|
||||
<<: *erpnext_backend_image
|
||||
|
||||
scheduler:
|
||||
image: frappe/erpnext-worker:${ERPNEXT_VERSION}
|
||||
<<: *erpnext_backend_image
|
||||
|
@ -16,7 +16,7 @@ services:
|
||||
- --entrypoints.websecure.address=:443
|
||||
- --certificatesResolvers.main-resolver.acme.httpChallenge=true
|
||||
- --certificatesResolvers.main-resolver.acme.httpChallenge.entrypoint=web
|
||||
- --certificatesResolvers.main-resolver.acme.email=${LETSENCRYPT_EMAIL}
|
||||
- --certificatesResolvers.main-resolver.acme.email=${LETSENCRYPT_EMAIL:?No Let's Encrypt email set}
|
||||
- --certificatesResolvers.main-resolver.acme.storage=/letsencrypt/acme.json
|
||||
ports:
|
||||
- 443:443
|
||||
|
@ -13,6 +13,6 @@ services:
|
||||
retries: 15
|
||||
command: []
|
||||
environment:
|
||||
POSTGRES_PASSWORD: ${DB_PASSWORD}
|
||||
POSTGRES_PASSWORD: ${DB_PASSWORD:?No db password set}
|
||||
volumes:
|
||||
- db-data:/var/lib/postgresql
|
||||
|
Loading…
Reference in New Issue
Block a user