|
docker-compose.yml
services:
backend:
image: frappe/erpnext:v15.60.1
container_name: erpnext-backend
platform: linux/amd64
pull_policy: always
restart: always
depends_on:
mariadb:
condition: service_healthy
redis-cache:
condition: service_healthy
configurator:
condition: service_completed_successfully
volumes:
- /www/wwwroot/m.teochew.jp/sites:/home/frappe/frappe-bench/sites
- /www/wwwroot/m.teochew.jp/apps:/home/frappe/frappe-bench/apps
- /www/wwwroot/m.teochew.jp/logs:/home/frappe/frappe-bench/logs
ports:
- "8000:8000"
networks:
- default
mariadb:
image: mariadb:10.6
container_name: erpnext-mariadb
restart: always
environment:
MYSQL_ROOT_PASSWORD: f78gwiN4ZZIC9k
# MYSQL_DATABASE: erpnext
# MYSQL_USER: erpnext
MYSQL_PASSWORD: f78gwiN4ZZIC9k
healthcheck:
test: ["CMD", "mysqladmin", "ping", "-h", "localhost"]
interval: 10s
timeout: 5s
retries: 5
volumes:
- ./volumes/mariadb_data:/var/lib/mysql
# - ./config/init.sql:/docker-entrypoint-initdb.d/init.sql
networks:
- default
redis-cache:
image: redis:6
container_name: erpnext-redis
restart: always
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 10s
timeout: 5s
retries: 5
networks:
- default
frontend:
image: frappe/erpnext:v15.60.1
container_name: erpnext-frontend
working_dir: /home/frappe/frappe-bench
entrypoint: ["/bin/bash", "-c"]
command: >
if [ ! -f sites/assets-bundled.flag ]; then
echo "Building assets..." &&
yarn install &&
bench build &&
touch sites/assets-bundled.flag;
else
echo "Assets already built, skipping.";
fi
user: "frappe"
depends_on:
- backend
volumes:
- /www/wwwroot/m.teochew.jp/sites:/home/frappe/frappe-bench/sites
- /www/wwwroot/m.teochew.jp/apps:/home/frappe/frappe-bench/apps
- /www/wwwroot/m.teochew.jp:/home/frappe/frappe-bench
networks:
- default
# frontend:
# container_name: erpnext-frontend
# ports:
# - "8000:8000"
# depends_on:
# - backend
# - websocket
# environment:
# BACKEND: backend:8000
# CLIENT_MAX_BODY_SIZE: 10M
# FRAPPE_SITE_NAME_HEADER: $$host
# PROXY_READ_TIMEOUT: "120"
# SOCKETIO: websocket:9000
# UPSTREAM_REAL_IP_ADDRESS: 127.0.0.1
# UPSTREAM_REAL_IP_HEADER: X-Forwarded-For
# UPSTREAM_REAL_IP_RECURSIVE: "off"
# image: frappe/erpnext:v15.60.1
# networks:
# - default
# platform: linux/amd64
# pull_policy: always
# restart: always
# volumes:
# - type: volume
# source: sites
# target: /home/frappe/frappe-bench/sites
configurator:
image: frappe/erpnext:v15.60.1
container_name: erpnext-configurator
platform: linux/amd64
pull_policy: always
restart: on-failure
# entrypoint:
# - bash
# command:
# - -c
# - |
# echo 'Setting Frappe Redis and DB configs...';
# cd /home/frappe/frappe-bench &&
# ls -1 apps > sites/apps.txt &&
# bench set-config -g db_host "$DB_HOST" &&
# bench set-config -gp db_port "$DB_PORT" &&
# bench set-config -g redis_cache "$REDIS_CACHE" &&
# bench set-config -g redis_queue "$REDIS_QUEUE" &&
# bench set-config -g redis_socketio "$REDIS_SOCKETIO" &&
# bench set-config -gp socketio_port "$SOCKETIO_PORT";
entrypoint: ["bash", "-c"]
command: >
echo 'Setting Frappe Redis and DB configs...';
cd /home/frappe/frappe-bench &&
ls -1 apps > sites/apps.txt &&
bench set-config -g db_host "$DB_HOST" &&
bench set-config -gp db_port "$DB_PORT" &&
bench set-config -g redis_cache "$REDIS_CACHE" &&
bench set-config -g redis_queue "$REDIS_QUEUE" &&
bench set-config -g redis_socketio "$REDIS_SOCKETIO" &&
bench set-config -gp socketio_port "$SOCKETIO_PORT";
environment:
DB_HOST: mariadb
DB_PORT: 3306
REDIS_CACHE: redis://redis-cache:6379
REDIS_QUEUE: redis://redis-cache:6379
REDIS_SOCKETIO: redis://redis-cache:6379
SOCKETIO_PORT: "9000"
volumes:
- /www/wwwroot/m.teochew.jp/sites:/home/frappe/frappe-bench/sites
- /www/wwwroot/m.teochew.jp/apps:/home/frappe/frappe-bench/apps
networks:
- default
socketio:
image: frappe/erpnext:v15.60.1
container_name: erpnext-socketio
restart: always
depends_on:
redis-cache:
condition: service_healthy
environment:
REDIS_URL: redis://redis-cache:6379
REDIS_CACHE: redis://redis-cache:6379
REDIS_QUEUE: redis://redis-cache:6379
REDIS_SOCKETIO: redis://redis-cache:6379
SOCKETIO_PORT: 9000
networks:
- default
websocket:
image: frappe/erpnext:v15.60.1
container_name: erpnext-websocket
platform: linux/amd64
pull_policy: always
restart: always
command:
- node
- /home/frappe/frappe-bench/apps/frappe/socketio.js
depends_on:
configurator:
condition: service_completed_successfully
environment:
- REDIS_URL=redis://redis-cache:6379
volumes:
- /www/wwwroot/m.teochew.jp/sites:/home/frappe/frappe-bench/sites
networks:
- default
queue-long:
image: frappe/erpnext:v15.60.1
container_name: erpnext-queue-long
platform: linux/amd64
pull_policy: always
restart: always
command: ["bench", "worker", "--queue", "long,default,short"]
depends_on:
configurator:
condition: service_completed_successfully
volumes:
- /www/wwwroot/m.teochew.jp/sites:/home/frappe/frappe-bench/sites
networks:
- default
queue-short:
image: frappe/erpnext:v15.60.1
container_name: erpnext-queue-short
platform: linux/amd64
pull_policy: always
restart: always
command: ["bench", "worker", "--queue", "short,default"]
depends_on:
configurator:
condition: service_completed_successfully
volumes:
- /www/wwwroot/m.teochew.jp/sites:/home/frappe/frappe-bench/sites
networks:
- default
scheduler:
image: frappe/erpnext:v15.60.1
container_name: erpnext-scheduler
platform: linux/amd64
pull_policy: always
restart: always
command: ["bench", "schedule"]
depends_on:
configurator:
condition: service_completed_successfully
volumes:
- /www/wwwroot/m.teochew.jp/sites:/home/frappe/frappe-bench/sites
networks:
- default
init-site:
image: frappe/erpnext:v15.60.1
container_name: erpnext-init-site
restart: "no"
tty: false
stdin_open: false
depends_on:
mariadb:
condition: service_healthy
redis-cache:
condition: service_healthy
entrypoint:
- bash
- -lc
- |
set -e
echo " |
|