feat: update configuration

This commit is contained in:
Bohdan Kucherivayi 2024-12-01 23:12:37 +02:00
parent db5cd22d4c
commit 4dcf23ebb7
4 changed files with 80 additions and 90 deletions

View file

@ -1,3 +1,17 @@
# docker compose -f compose.yaml -f overrides/compose.mariadb.yaml -f overrides/compose.redis.yaml -f overrides/compose.noproxy.yaml config > docker-compose.yml # Compose File
# docker compose -f docker-compose.yml up -d You can just combine multiple compose files into one with the `docker compose` command. This is useful when you have a base compose file and you want to add additional services or configurations to it. (current situation)
## Use this command to combine the compose files
```bash
docker compose -f compose.yaml -f overrides/compose.mariadb.yaml -f overrides/compose.redis.yaml -f overrides/compose.noproxy.yaml config > docker-compose.yaml
```
# Use this command to start the services
```bash
docker compose --env-file ~/ -f docker-compose.yaml up -d
```
P.S.: Do not forget to fill the `.env` file with the necessary environment variables. You can use `.env.example` as a template.

View file

@ -13,7 +13,8 @@ x-depends-on-configurator: &depends_on_configurator
x-backend-defaults: &backend_defaults x-backend-defaults: &backend_defaults
<<: [*depends_on_configurator, *customizable_image] <<: [*depends_on_configurator, *customizable_image]
volumes: volumes:
- erp-bench:/home/frappe/frappe-bench - sites:/home/frappe/frappe-bench/sites
- logs:/home/frappe/frappe-bench/logs
services: services:
configurator: configurator:
@ -57,9 +58,9 @@ services:
UPSTREAM_REAL_IP_HEADER: ${UPSTREAM_REAL_IP_HEADER:-X-Forwarded-For} UPSTREAM_REAL_IP_HEADER: ${UPSTREAM_REAL_IP_HEADER:-X-Forwarded-For}
UPSTREAM_REAL_IP_RECURSIVE: ${UPSTREAM_REAL_IP_RECURSIVE:-off} UPSTREAM_REAL_IP_RECURSIVE: ${UPSTREAM_REAL_IP_RECURSIVE:-off}
PROXY_READ_TIMEOUT: ${PROXY_READ_TIMEOUT:-120} PROXY_READ_TIMEOUT: ${PROXY_READ_TIMEOUT:-120}
CLIENT_MAX_BODY_SIZE: ${CLIENT_MAX_BODY_SIZE:-50m} CLIENT_MAX_BODY_SIZE: ${CLIENT_MAX_BODY_SIZE:-100m}
volumes: volumes:
- erp-bench:/home/frappe/frappe-bench - sites:/home/frappe/frappe-bench/sites
depends_on: depends_on:
- backend - backend
- websocket - websocket
@ -71,7 +72,7 @@ services:
- node - node
- /home/frappe/frappe-bench/apps/frappe/socketio.js - /home/frappe/frappe-bench/apps/frappe/socketio.js
volumes: volumes:
- erp-bench:/home/frappe/frappe-bench - sites:/home/frappe/frappe-bench/sites
queue-short: queue-short:
<<: *backend_defaults <<: *backend_defaults
@ -89,4 +90,5 @@ services:
command: bench schedule command: bench schedule
volumes: volumes:
erp-bench: sites:
logs:

View file

@ -5,70 +5,46 @@ services:
configurator: configurator:
condition: service_completed_successfully condition: service_completed_successfully
required: true required: true
image: zapal/erp:v15.12.2 image: zapal/erp:version-15
networks: networks:
default: null default: null
platform: linux/amd64 platform: linux/amd64
pull_policy: always pull_policy: always
volumes: volumes:
- type: volume - type: volume
source: erp-bench source: sites
target: /home/frappe/frappe-bench target: /home/frappe/frappe-bench/sites
volume: {}
- type: volume
source: logs
target: /home/frappe/frappe-bench/logs
volume: {} volume: {}
configurator: configurator:
command: command:
- | - |
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://$$REDIS_CACHE"; bench set-config -g redis_queue "redis://$$REDIS_QUEUE"; bench set-config -g redis_socketio "redis://$$REDIS_QUEUE"; bench set-config -gp socketio_port $$SOCKETIO_PORT; 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://$$REDIS_CACHE"; bench set-config -g redis_queue "redis://$$REDIS_QUEUE"; bench set-config -g redis_socketio "redis://$$REDIS_QUEUE"; bench set-config -gp socketio_port $$SOCKETIO_PORT;
depends_on:
db:
condition: service_healthy
required: true
redis-cache:
condition: service_started
required: true
redis-queue:
condition: service_started
required: true
entrypoint: entrypoint:
- bash - bash
- -c - -c
environment: environment:
DB_HOST: db DB_HOST: ""
DB_PORT: "3306" DB_PORT: ""
REDIS_CACHE: redis-cache:6379 REDIS_CACHE: ""
REDIS_QUEUE: redis-queue:6379 REDIS_QUEUE: ""
SOCKETIO_PORT: "9000" SOCKETIO_PORT: "9000"
image: zapal/erp:v15.12.2 image: zapal/erp:version-15
networks: networks:
default: null default: null
platform: linux/amd64 platform: linux/amd64
pull_policy: always pull_policy: always
volumes: volumes:
- type: volume - type: volume
source: erp-bench source: sites
target: /home/frappe/frappe-bench target: /home/frappe/frappe-bench/sites
volume: {} volume: {}
db:
command:
- --character-set-server=utf8mb4
- --collation-server=utf8mb4_unicode_ci
- --skip-character-set-client-handshake
- --skip-innodb-read-only-compressed
environment:
MYSQL_ROOT_PASSWORD: "123"
healthcheck:
test:
- CMD-SHELL
- mysqladmin ping -h localhost --password=123
interval: 1s
retries: 20
image: mariadb:10.6
networks:
default: null
volumes:
- type: volume - type: volume
source: db-data source: logs
target: /var/lib/mysql target: /home/frappe/frappe-bench/logs
volume: {} volume: {}
frontend: frontend:
command: command:
@ -82,14 +58,14 @@ services:
required: true required: true
environment: environment:
BACKEND: backend:8000 BACKEND: backend:8000
CLIENT_MAX_BODY_SIZE: 50m CLIENT_MAX_BODY_SIZE: 100m
FRAPPE_SITE_NAME_HEADER: $$host FRAPPE_SITE_NAME_HEADER: $$host
PROXY_READ_TIMEOUT: "120" PROXY_READ_TIMEOUT: "120"
SOCKETIO: websocket:9000 SOCKETIO: websocket:9000
UPSTREAM_REAL_IP_ADDRESS: 127.0.0.1 UPSTREAM_REAL_IP_ADDRESS: 127.0.0.1
UPSTREAM_REAL_IP_HEADER: X-Forwarded-For UPSTREAM_REAL_IP_HEADER: X-Forwarded-For
UPSTREAM_REAL_IP_RECURSIVE: "off" UPSTREAM_REAL_IP_RECURSIVE: "off"
image: zapal/erp:v15.12.2 image: zapal/erp:version-15
networks: networks:
default: null default: null
platform: linux/amd64 platform: linux/amd64
@ -101,8 +77,8 @@ services:
pull_policy: always pull_policy: always
volumes: volumes:
- type: volume - type: volume
source: erp-bench source: sites
target: /home/frappe/frappe-bench target: /home/frappe/frappe-bench/sites
volume: {} volume: {}
queue-long: queue-long:
command: command:
@ -114,15 +90,19 @@ services:
configurator: configurator:
condition: service_completed_successfully condition: service_completed_successfully
required: true required: true
image: zapal/erp:v15.12.2 image: zapal/erp:version-15
networks: networks:
default: null default: null
platform: linux/amd64 platform: linux/amd64
pull_policy: always pull_policy: always
volumes: volumes:
- type: volume - type: volume
source: erp-bench source: sites
target: /home/frappe/frappe-bench target: /home/frappe/frappe-bench/sites
volume: {}
- type: volume
source: logs
target: /home/frappe/frappe-bench/logs
volume: {} volume: {}
queue-short: queue-short:
command: command:
@ -134,33 +114,19 @@ services:
configurator: configurator:
condition: service_completed_successfully condition: service_completed_successfully
required: true required: true
image: zapal/erp:v15.12.2 image: zapal/erp:version-15
networks: networks:
default: null default: null
platform: linux/amd64 platform: linux/amd64
pull_policy: always pull_policy: always
volumes: volumes:
- type: volume - type: volume
source: erp-bench source: sites
target: /home/frappe/frappe-bench target: /home/frappe/frappe-bench/sites
volume: {} volume: {}
redis-cache:
image: redis:6.2-alpine
networks:
default: null
volumes:
- type: volume - type: volume
source: redis-cache-data source: logs
target: /data target: /home/frappe/frappe-bench/logs
volume: {}
redis-queue:
image: redis:6.2-alpine
networks:
default: null
volumes:
- type: volume
source: redis-queue-data
target: /data
volume: {} volume: {}
scheduler: scheduler:
command: command:
@ -170,15 +136,19 @@ services:
configurator: configurator:
condition: service_completed_successfully condition: service_completed_successfully
required: true required: true
image: zapal/erp:v15.12.2 image: zapal/erp:version-15
networks: networks:
default: null default: null
platform: linux/amd64 platform: linux/amd64
pull_policy: always pull_policy: always
volumes: volumes:
- type: volume - type: volume
source: erp-bench source: sites
target: /home/frappe/frappe-bench target: /home/frappe/frappe-bench/sites
volume: {}
- type: volume
source: logs
target: /home/frappe/frappe-bench/logs
volume: {} volume: {}
websocket: websocket:
command: command:
@ -188,38 +158,37 @@ services:
configurator: configurator:
condition: service_completed_successfully condition: service_completed_successfully
required: true required: true
image: zapal/erp:v15.12.2 image: zapal/erp:version-15
networks: networks:
default: null default: null
platform: linux/amd64 platform: linux/amd64
pull_policy: always pull_policy: always
volumes: volumes:
- type: volume - type: volume
source: erp-bench source: sites
target: /home/frappe/frappe-bench target: /home/frappe/frappe-bench/sites
volume: {} volume: {}
networks: networks:
default: default:
name: erp_default name: erp_default
volumes: volumes:
db-data: logs:
name: erp_db-data name: logs
erp-bench: external: true
name: erp_erp-bench sites:
redis-cache-data: name: sites
name: erp_redis-cache-data external: true
redis-queue-data:
name: erp_redis-queue-data
x-backend-defaults: x-backend-defaults:
depends_on: depends_on:
configurator: configurator:
condition: service_completed_successfully condition: service_completed_successfully
image: zapal/erp:v15.12.2 image: zapal/erp:version-15
pull_policy: always pull_policy: always
volumes: volumes:
- erp-bench:/home/frappe/frappe-bench - sites:/home/frappe/frappe-bench/sites
- logs:/home/frappe/frappe-bench/logs
x-customizable-image: x-customizable-image:
image: zapal/erp:v15.12.2 image: zapal/erp:version-15
pull_policy: always pull_policy: always
x-depends-on-configurator: x-depends-on-configurator:
depends_on: depends_on:

View file

@ -0,0 +1,5 @@
volumes:
sites:
external: true
logs:
external: true