Browse Source

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

experimental
Hugo Sales 1 week ago
parent
commit
0dd4b62ded
Signed by: someonewithpc <hugo@hsal.es> GPG Key ID: 7D0C7EAFC9D835A0
2 changed files with 25 additions and 1 deletions
  1. +19
    -1
      docker-compose.yaml.default
  2. +6
    -0
      docker/social/worker.sh

+ 19
- 1
docker-compose.yaml.default View File

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


+ 6
- 0
docker/social/worker.sh 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

Loading…
Cancel
Save