Skip to content

Commit

Permalink
Add autorestart to Supervisor config
Browse files Browse the repository at this point in the history
  • Loading branch information
dbpolito committed Sep 4, 2024
1 parent dccdce3 commit af662a0
Show file tree
Hide file tree
Showing 18 changed files with 117 additions and 63 deletions.
4 changes: 3 additions & 1 deletion 8.0-swoole-nginx-prod/supervisor.conf
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
[program:nginx]
depends_on = octane
command = nginx -g "daemon off;"
autorestart = true
stopasgroup = true
stderr_logfile = /dev/stderr
stdout_logfile = /dev/stdout

[program:octane]
command = su-exec kool php artisan octane:start --server=swoole
command = su-exec kool php artisan octane:start
autorestart = true
stopasgroup = true
stderr_logfile = /dev/stderr
stdout_logfile = /dev/stdout
4 changes: 3 additions & 1 deletion 8.0-swoole-nginx/supervisor.conf
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
[program:nginx]
depends_on = octane
command = nginx -g "daemon off;"
autorestart = true
stopasgroup = true
stderr_logfile = /dev/stderr
stdout_logfile = /dev/stdout

[program:octane]
command = su-exec kool php artisan octane:start --server=swoole --watch
command = su-exec kool php artisan octane:start --watch
autorestart = true
stopasgroup = true
stderr_logfile = /dev/stderr
stdout_logfile = /dev/stdout
16 changes: 10 additions & 6 deletions 8.0-swoole-prod/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
FROM kooldev/php:8.0-prod

RUN apk add --no-cache --virtual .build-deps $PHPIZE_DEPS && \
pecl install swoole && \
docker-php-ext-enable swoole && \
# cleanup
apk del .build-deps && \
rm -rf /var/cache/apk/* /tmp/*
COPY --from=mlocati/php-extension-installer /usr/bin/install-php-extensions /usr/local/bin/

RUN install-php-extensions swoole

# RUN apk add --no-cache --virtual .build-deps $PHPIZE_DEPS && \
# pecl install swoole && \
# docker-php-ext-enable swoole && \
# # cleanup
# apk del .build-deps && \
# rm -rf /var/cache/apk/* /tmp/*
16 changes: 10 additions & 6 deletions 8.0-swoole/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
FROM kooldev/php:8.0-node

RUN apk add --no-cache --virtual .build-deps $PHPIZE_DEPS && \
pecl install swoole && \
docker-php-ext-enable swoole && \
# cleanup
apk del .build-deps && \
rm -rf /var/cache/apk/* /tmp/*
COPY --from=mlocati/php-extension-installer /usr/bin/install-php-extensions /usr/local/bin/

RUN install-php-extensions swoole

# RUN apk add --no-cache --virtual .build-deps $PHPIZE_DEPS && \
# pecl install swoole && \
# docker-php-ext-enable swoole && \
# # cleanup
# apk del .build-deps && \
# rm -rf /var/cache/apk/* /tmp/*
4 changes: 3 additions & 1 deletion 8.1-swoole-nginx-prod/supervisor.conf
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
[program:nginx]
depends_on = octane
command = nginx -g "daemon off;"
autorestart = true
stopasgroup = true
stderr_logfile = /dev/stderr
stdout_logfile = /dev/stdout

[program:octane]
command = su-exec kool php artisan octane:start --server=swoole
command = su-exec kool php artisan octane:start
autorestart = true
stopasgroup = true
stderr_logfile = /dev/stderr
stdout_logfile = /dev/stdout
4 changes: 3 additions & 1 deletion 8.1-swoole-nginx/supervisor.conf
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
[program:nginx]
depends_on = octane
command = nginx -g "daemon off;"
autorestart = true
stopasgroup = true
stderr_logfile = /dev/stderr
stdout_logfile = /dev/stdout

[program:octane]
command = su-exec kool php artisan octane:start --server=swoole --watch
command = su-exec kool php artisan octane:start --watch
autorestart = true
stopasgroup = true
stderr_logfile = /dev/stderr
stdout_logfile = /dev/stdout
16 changes: 10 additions & 6 deletions 8.1-swoole-prod/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
FROM kooldev/php:8.1-prod

RUN apk add --no-cache --virtual .build-deps $PHPIZE_DEPS && \
pecl install swoole && \
docker-php-ext-enable swoole && \
# cleanup
apk del .build-deps && \
rm -rf /var/cache/apk/* /tmp/*
COPY --from=mlocati/php-extension-installer /usr/bin/install-php-extensions /usr/local/bin/

RUN install-php-extensions swoole

# RUN apk add --no-cache --virtual .build-deps $PHPIZE_DEPS && \
# pecl install swoole && \
# docker-php-ext-enable swoole && \
# # cleanup
# apk del .build-deps && \
# rm -rf /var/cache/apk/* /tmp/*
16 changes: 10 additions & 6 deletions 8.1-swoole/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
FROM kooldev/php:8.1-node

RUN apk add --no-cache --virtual .build-deps $PHPIZE_DEPS && \
pecl install swoole && \
docker-php-ext-enable swoole && \
# cleanup
apk del .build-deps && \
rm -rf /var/cache/apk/* /tmp/*
COPY --from=mlocati/php-extension-installer /usr/bin/install-php-extensions /usr/local/bin/

RUN install-php-extensions swoole

# RUN apk add --no-cache --virtual .build-deps $PHPIZE_DEPS && \
# pecl install swoole && \
# docker-php-ext-enable swoole && \
# # cleanup
# apk del .build-deps && \
# rm -rf /var/cache/apk/* /tmp/*
4 changes: 3 additions & 1 deletion 8.2-swoole-nginx-prod/supervisor.conf
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
[program:nginx]
depends_on = octane
command = nginx -g "daemon off;"
autorestart = true
stopasgroup = true
stderr_logfile = /dev/stderr
stdout_logfile = /dev/stdout

[program:octane]
command = su-exec kool php artisan octane:start --server=swoole
command = su-exec kool php artisan octane:start
autorestart = true
stopasgroup = true
stderr_logfile = /dev/stderr
stdout_logfile = /dev/stdout
4 changes: 3 additions & 1 deletion 8.2-swoole-nginx/supervisor.conf
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
[program:nginx]
depends_on = octane
command = nginx -g "daemon off;"
autorestart = true
stopasgroup = true
stderr_logfile = /dev/stderr
stdout_logfile = /dev/stdout

[program:octane]
command = su-exec kool php artisan octane:start --server=swoole --watch
command = su-exec kool php artisan octane:start --watch
autorestart = true
stopasgroup = true
stderr_logfile = /dev/stderr
stdout_logfile = /dev/stdout
16 changes: 10 additions & 6 deletions 8.2-swoole-prod/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
FROM kooldev/php:8.2-prod

RUN apk add --no-cache --virtual .build-deps $PHPIZE_DEPS && \
pecl install swoole && \
docker-php-ext-enable swoole && \
# cleanup
apk del .build-deps && \
rm -rf /var/cache/apk/* /tmp/*
COPY --from=mlocati/php-extension-installer /usr/bin/install-php-extensions /usr/local/bin/

RUN install-php-extensions swoole

# RUN apk add --no-cache --virtual .build-deps $PHPIZE_DEPS && \
# pecl install swoole && \
# docker-php-ext-enable swoole && \
# # cleanup
# apk del .build-deps && \
# rm -rf /var/cache/apk/* /tmp/*
16 changes: 10 additions & 6 deletions 8.2-swoole/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
FROM kooldev/php:8.2-node

RUN apk add --no-cache --virtual .build-deps $PHPIZE_DEPS && \
pecl install swoole && \
docker-php-ext-enable swoole && \
# cleanup
apk del .build-deps && \
rm -rf /var/cache/apk/* /tmp/*
COPY --from=mlocati/php-extension-installer /usr/bin/install-php-extensions /usr/local/bin/

RUN install-php-extensions swoole

# RUN apk add --no-cache --virtual .build-deps $PHPIZE_DEPS && \
# pecl install swoole && \
# docker-php-ext-enable swoole && \
# # cleanup
# apk del .build-deps && \
# rm -rf /var/cache/apk/* /tmp/*
4 changes: 3 additions & 1 deletion 8.3-swoole-nginx-prod/supervisor.conf
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
[program:nginx]
depends_on = octane
command = nginx -g "daemon off;"
autorestart = true
stopasgroup = true
stderr_logfile = /dev/stderr
stdout_logfile = /dev/stdout

[program:octane]
command = su-exec kool php artisan octane:start --server=swoole
command = su-exec kool php artisan octane:start
autorestart = true
stopasgroup = true
stderr_logfile = /dev/stderr
stdout_logfile = /dev/stdout
4 changes: 3 additions & 1 deletion 8.3-swoole-nginx/supervisor.conf
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
[program:nginx]
depends_on = octane
command = nginx -g "daemon off;"
autorestart = true
stopasgroup = true
stderr_logfile = /dev/stderr
stdout_logfile = /dev/stdout

[program:octane]
command = su-exec kool php artisan octane:start --server=swoole --watch
command = su-exec kool php artisan octane:start --watch
autorestart = true
stopasgroup = true
stderr_logfile = /dev/stderr
stdout_logfile = /dev/stdout
16 changes: 10 additions & 6 deletions 8.3-swoole-prod/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
FROM kooldev/php:8.3-prod

RUN apk add --no-cache --virtual .build-deps $PHPIZE_DEPS && \
pecl install swoole && \
docker-php-ext-enable swoole && \
# cleanup
apk del .build-deps && \
rm -rf /var/cache/apk/* /tmp/*
COPY --from=mlocati/php-extension-installer /usr/bin/install-php-extensions /usr/local/bin/

RUN install-php-extensions swoole

# RUN apk add --no-cache --virtual .build-deps $PHPIZE_DEPS && \
# pecl install swoole && \
# docker-php-ext-enable swoole && \
# # cleanup
# apk del .build-deps && \
# rm -rf /var/cache/apk/* /tmp/*
16 changes: 10 additions & 6 deletions 8.3-swoole/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
FROM kooldev/php:8.3-node

RUN apk add --no-cache --virtual .build-deps $PHPIZE_DEPS && \
pecl install swoole && \
docker-php-ext-enable swoole && \
# cleanup
apk del .build-deps && \
rm -rf /var/cache/apk/* /tmp/*
COPY --from=mlocati/php-extension-installer /usr/bin/install-php-extensions /usr/local/bin/

RUN install-php-extensions swoole

# RUN apk add --no-cache --virtual .build-deps $PHPIZE_DEPS && \
# pecl install swoole && \
# docker-php-ext-enable swoole && \
# # cleanup
# apk del .build-deps && \
# rm -rf /var/cache/apk/* /tmp/*
16 changes: 10 additions & 6 deletions template/Dockerfile.blade.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
FROM {{ $from }}

RUN apk add --no-cache --virtual .build-deps $PHPIZE_DEPS && \
pecl install swoole && \
docker-php-ext-enable swoole && \
# cleanup
apk del .build-deps && \
rm -rf /var/cache/apk/* /tmp/*
COPY --from=mlocati/php-extension-installer /usr/bin/install-php-extensions /usr/local/bin/

RUN install-php-extensions swoole

# RUN apk add --no-cache --virtual .build-deps $PHPIZE_DEPS && \
# pecl install swoole && \
# docker-php-ext-enable swoole && \
# # cleanup
# apk del .build-deps && \
# rm -rf /var/cache/apk/* /tmp/*
4 changes: 3 additions & 1 deletion template/supervisor-conf.blade.php
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
[program:nginx]
depends_on = octane
command = nginx -g "daemon off;"
autorestart = true
stopasgroup = true
stderr_logfile = /dev/stderr
stdout_logfile = /dev/stdout

[program:octane]
command = su-exec kool php artisan octane:start --server=swoole{!! $prod ? '' : ' --watch' !!}
command = su-exec kool php artisan octane:start{!! $prod ? '' : ' --watch' !!}
autorestart = true
stopasgroup = true
stderr_logfile = /dev/stderr
stdout_logfile = /dev/stdout

0 comments on commit af662a0

Please sign in to comment.