[TOOLS][DOCKER] Add worker container and script, which handles the queues

This commit is contained in:
Hugo Sales 2021-11-15 19:19:29 +00:00
parent 5e4ada7b78
commit 0dd4b62ded
No known key found for this signature in database
GPG Key ID: 7D0C7EAFC9D835A0
2 changed files with 25 additions and 1 deletions

View File

@ -55,7 +55,25 @@ services:
- ./docker/social/install.sh:/var/entrypoint.d/social_install.sh - ./docker/social/install.sh:/var/entrypoint.d/social_install.sh
# Main files # Main files
- .:/var/www/social - .:/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: env_file:
- ./docker/social/social.env - ./docker/social/social.env
- ./docker/db/db.env - ./docker/db/db.env

6
docker/social/worker.sh Executable file
View File

@ -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