Skip to content

Commit 011eb00

Browse files
committed
Improve messenger async consumer
References: - dunglas/symfony-docker#681
1 parent be0fe1e commit 011eb00

File tree

4 files changed

+15
-6
lines changed

4 files changed

+15
-6
lines changed

compose.override.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ services:
3232
build:
3333
context: .
3434
target: frankenphp_dev
35-
command: ['/app/bin/console', 'messenger:consume', 'events', '-vvv', '--time-limit=60', '--limit=10', '--memory-limit=128M']
35+
command: ['bin/console', 'messenger:consume', 'events', '-vvv', '--time-limit=60', '--limit=10', '--memory-limit=128M']
3636
volumes:
3737
- ./:/app
3838
- /app/var/

compose.prod.yaml

+12-2
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,18 @@ services:
1010
MERCURE_SUBSCRIBER_JWT_KEY: ${CADDY_MERCURE_JWT_SECRET}
1111

1212
php-worker:
13+
profiles:
14+
- donotstart
15+
16+
php-worker-events:
17+
extends:
18+
file: compose.yaml
19+
service: php-worker
20+
image: ${IMAGES_PREFIX:-}app-php-worker-events
1321
build:
1422
context: .
1523
target: frankenphp_prod
16-
environment:
17-
APP_SECRET: ${APP_SECRET}
24+
command: ['bin/console', 'messenger:consume', 'events', '-vvv', '--time-limit=60', '--limit=10', '--memory-limit=128M']
25+
depends_on:
26+
php:
27+
condition: service_healthy

etc/frankenphp/docker-entrypoint.sh

+1-2
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,7 @@ if [ "$1" = 'frankenphp' ] || [ "$1" = 'php' ] || [ "$1" = 'bin/console' ]; then
2626
composer install --prefer-dist --no-progress --no-interaction
2727
fi
2828

29-
run_migrations=${RUN_MIGRATIONS:-true}
30-
if grep -q ^DATABASE_URL= .env && [ "$run_migrations" = "true" ]; then
29+
if grep -q ^DATABASE_URL= .env && [ "${RUN_MIGRATIONS:-true}" = "true" ]; then
3130
echo "Waiting for database to be ready..."
3231
ATTEMPTS_LEFT_TO_REACH_DATABASE=60
3332
until [ $ATTEMPTS_LEFT_TO_REACH_DATABASE -eq 0 ] || DATABASE_ERROR=$(php bin/console dbal:run-sql -q "SELECT 1" 2>&1); do

etc/helm/dolphin/templates/deployment-workers.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ spec:
3535
{{- toYaml .Values.securityContext | nindent 12 }}
3636
image: "{{ .Values.php.image.repository }}:{{ .Values.php.image.tag | default .Chart.AppVersion }}"
3737
imagePullPolicy: {{ .Values.php.image.pullPolicy }}
38-
command: ['/app/bin/console', 'messenger:consume', 'events', '-vvv', '--time-limit=60', '--limit=10', '--memory-limit=128M']
38+
command: ['bin/console', 'messenger:consume', 'events', '-vvv', '--time-limit=60', '--limit=10', '--memory-limit=128M']
3939
env:
4040
- name: RUN_MIGRATIONS
4141
value: "false"

0 commit comments

Comments
 (0)