2
0
mirror of https://github.com/frappe/frappe_docker.git synced 2024-11-09 23:00:56 +00:00

fix: use 3 redis services instead of 1 (#859)

* fix: use 3 redis services instead of 1

* fix: waititing for redis
This commit is contained in:
Revant Nandgaonkar 2022-07-24 11:29:18 +05:30 committed by GitHub
parent 95711cc847
commit c8682e4857
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

34
pwd.yml
View File

@ -17,9 +17,9 @@ services:
environment: environment:
DB_HOST: db DB_HOST: db
DB_PORT: "3306" DB_PORT: "3306"
REDIS_CACHE: redis:6379/0 REDIS_CACHE: redis-cache:6379
REDIS_QUEUE: redis:6379/1 REDIS_QUEUE: redis-queue:6379
REDIS_SOCKETIO: redis:6379/2 REDIS_SOCKETIO: redis-socketio:6379
SOCKETIO_PORT: "9000" SOCKETIO_PORT: "9000"
volumes: volumes:
- sites:/home/frappe/frappe-bench/sites - sites:/home/frappe/frappe-bench/sites
@ -38,7 +38,9 @@ services:
command: command:
- > - >
wait-for-it -t 120 db:3306; wait-for-it -t 120 db:3306;
wait-for-it -t 120 redis:6379; wait-for-it -t 120 redis-cache:6379;
wait-for-it -t 120 redis-queue:6379;
wait-for-it -t 120 redis-socketio:6379;
export start=`date +%s`; export start=`date +%s`;
until [[ -n `grep -hs ^ common_site_config.json | jq -r ".db_host // empty"` ]] && \ until [[ -n `grep -hs ^ common_site_config.json | jq -r ".db_host // empty"` ]] && \
[[ -n `grep -hs ^ common_site_config.json | jq -r ".redis_cache // empty"` ]] && \ [[ -n `grep -hs ^ common_site_config.json | jq -r ".redis_cache // empty"` ]] && \
@ -130,13 +132,29 @@ services:
volumes: volumes:
- sites:/home/frappe/frappe-bench/sites - sites:/home/frappe/frappe-bench/sites
redis: redis-queue:
image: redis:6.2-alpine image: redis:6.2-alpine
deploy: deploy:
restart_policy: restart_policy:
condition: on-failure condition: on-failure
volumes: volumes:
- redis-data:/data - redis-queue-data:/data
redis-cache:
image: redis:6.2-alpine
deploy:
restart_policy:
condition: on-failure
volumes:
- redis-cache-data:/data
redis-socketio:
image: redis:6.2-alpine
deploy:
restart_policy:
condition: on-failure
volumes:
- redis-socketio-data:/data
scheduler: scheduler:
image: frappe/erpnext-worker:v13.36.1 image: frappe/erpnext-worker:v13.36.1
@ -160,5 +178,7 @@ services:
volumes: volumes:
assets: assets:
db-data: db-data:
redis-data: redis-queue-data:
redis-cache-data:
redis-socketio-data:
sites: sites: