Skip to content

Commit ef21aaa

Browse files
committed
add healthcheck to worker
1 parent 196b79c commit ef21aaa

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ RUN npm run build
1212
FROM dunglas/frankenphp:php8.2-bookworm
1313

1414
RUN apt-get update && \
15-
apt-get install -y unzip libnss3-tools && \
15+
apt-get install -y unzip libnss3-tools procps && \
1616
rm -rf /var/lib/apt/lists/*
1717

1818
RUN install-php-extensions \

docker-compose.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,13 @@ services:
9999

100100
worker:
101101
<<: *laravel-config
102-
command: ["php", "artisan", "queue:work"]
102+
command: ["php", "artisan", "queue:work", "-v"]
103103
depends_on:
104104
migrations:
105105
condition: service_completed_successfully
106+
107+
healthcheck:
108+
test: ["CMD-SHELL", 'pgrep -fl "php artisan queue:work"']
109+
interval: 1s
110+
timeout: 5s
111+
retries: 5

0 commit comments

Comments
 (0)