Skip to content

Commit 96a79b1

Browse files
authored
refactor: extract queue work to separate script (#8)
1 parent e603bd2 commit 96a79b1

File tree

3 files changed

+11
-7
lines changed

3 files changed

+11
-7
lines changed

8.4/Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ FROM serversideup/php:8.4-fpm-nginx-alpine
33
COPY --chmod=755 common/etc/entrypoint.d /etc/entrypoint.d
44
COPY --chmod=755 common/etc/s6-overlay /etc/s6-overlay
55
COPY --chmod=755 --chown=www-data:www-data common/etc/nginx /etc/nginx
6+
COPY --chmod=755 common/usr/local/bin /usr/local/bin
67

78
# PHP limits
89
ENV PHP_MEMORY_LIMIT=256M

common/etc/s6-overlay/s6-rc.d/queue/run

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,7 @@
22

33
if [ "$QUEUE_ENABLED" = "true" ]; then
44
echo "✅ Queue is enabled"
5-
php "$APP_BASE_DIR/artisan" queue:work \
6-
--max-jobs $QUEUE_MAX_JOBS \
7-
--sleep $QUEUE_SLEEP \
8-
--rest $QUEUE_REST \
9-
--timeout $QUEUE_TIMEOUT \
10-
--tries $QUEUE_TRIES \
11-
--force
5+
queue-work
126
else
137
echo "❌ Queue is disabled"
148
s6-svc -Od .

common/usr/local/bin/queue-work

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#!/bin/sh
2+
3+
artisan queue:work \
4+
--max-jobs $QUEUE_MAX_JOBS \
5+
--sleep $QUEUE_SLEEP \
6+
--rest $QUEUE_REST \
7+
--timeout $QUEUE_TIMEOUT \
8+
--tries $QUEUE_TRIES \
9+
--force

0 commit comments

Comments
 (0)