From 0dd4b62ded87479e24f1da803fefb6b12349aca1 Mon Sep 17 00:00:00 2001 From: Hugo Sales Date: Mon, 15 Nov 2021 19:19:29 +0000 Subject: [PATCH] [TOOLS][DOCKER] Add worker container and script, which handles the queues --- docker-compose.yaml.default | 20 +++++++++++++++++++- docker/social/worker.sh | 6 ++++++ 2 files changed, 25 insertions(+), 1 deletion(-) create mode 100755 docker/social/worker.sh diff --git a/docker-compose.yaml.default b/docker-compose.yaml.default index 527d6a4ea3..31785c1d07 100644 --- a/docker-compose.yaml.default +++ b/docker-compose.yaml.default @@ -55,7 +55,25 @@ services: - ./docker/social/install.sh:/var/entrypoint.d/social_install.sh # Main files - .:/var/www/social - - /var/www/social/docker + - /var/www/social/docker # don't map docker folder + env_file: + - ./docker/social/social.env + - ./docker/db/db.env + command: /entrypoint.sh + + worker: + build: docker/php + restart: always + tty: true + volumes: + # Entrypoint + - ./docker/php/entrypoint.sh:/entrypoint.sh + - ./docker/db/wait_for_db.sh:/wait_for_db.sh + - ./docker/social/install.sh:/var/entrypoint.d/10_social_install.sh + - ./docker/social/worker.sh:/var/entrypoint.d/20_social_worker.sh + # Main files + - .:/var/www/social + - /var/www/social/docker # don't map docker folder env_file: - ./docker/social/social.env - ./docker/db/db.env diff --git a/docker/social/worker.sh b/docker/social/worker.sh new file mode 100755 index 0000000000..220f6c7ca1 --- /dev/null +++ b/docker/social/worker.sh @@ -0,0 +1,6 @@ +#!/bin/sh + +cd /var/www/social || exit 65 +while :; do + bin/console messenger:consume high low -vv --limit=10 --memory-limit=128M --time-limit=3600 +done