Skip to content

Commit af662a0

Browse files
committed
Add autorestart to Supervisor config
1 parent dccdce3 commit af662a0

File tree

18 files changed

+117
-63
lines changed

18 files changed

+117
-63
lines changed

8.0-swoole-nginx-prod/supervisor.conf

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
[program:nginx]
22
depends_on = octane
33
command = nginx -g "daemon off;"
4+
autorestart = true
45
stopasgroup = true
56
stderr_logfile = /dev/stderr
67
stdout_logfile = /dev/stdout
78

89
[program:octane]
9-
command = su-exec kool php artisan octane:start --server=swoole
10+
command = su-exec kool php artisan octane:start
11+
autorestart = true
1012
stopasgroup = true
1113
stderr_logfile = /dev/stderr
1214
stdout_logfile = /dev/stdout

8.0-swoole-nginx/supervisor.conf

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
[program:nginx]
22
depends_on = octane
33
command = nginx -g "daemon off;"
4+
autorestart = true
45
stopasgroup = true
56
stderr_logfile = /dev/stderr
67
stdout_logfile = /dev/stdout
78

89
[program:octane]
9-
command = su-exec kool php artisan octane:start --server=swoole --watch
10+
command = su-exec kool php artisan octane:start --watch
11+
autorestart = true
1012
stopasgroup = true
1113
stderr_logfile = /dev/stderr
1214
stdout_logfile = /dev/stdout

8.0-swoole-prod/Dockerfile

+10-6
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
11
FROM kooldev/php:8.0-prod
22

3-
RUN apk add --no-cache --virtual .build-deps $PHPIZE_DEPS && \
4-
pecl install swoole && \
5-
docker-php-ext-enable swoole && \
6-
# cleanup
7-
apk del .build-deps && \
8-
rm -rf /var/cache/apk/* /tmp/*
3+
COPY --from=mlocati/php-extension-installer /usr/bin/install-php-extensions /usr/local/bin/
4+
5+
RUN install-php-extensions swoole
6+
7+
# RUN apk add --no-cache --virtual .build-deps $PHPIZE_DEPS && \
8+
# pecl install swoole && \
9+
# docker-php-ext-enable swoole && \
10+
# # cleanup
11+
# apk del .build-deps && \
12+
# rm -rf /var/cache/apk/* /tmp/*

8.0-swoole/Dockerfile

+10-6
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
11
FROM kooldev/php:8.0-node
22

3-
RUN apk add --no-cache --virtual .build-deps $PHPIZE_DEPS && \
4-
pecl install swoole && \
5-
docker-php-ext-enable swoole && \
6-
# cleanup
7-
apk del .build-deps && \
8-
rm -rf /var/cache/apk/* /tmp/*
3+
COPY --from=mlocati/php-extension-installer /usr/bin/install-php-extensions /usr/local/bin/
4+
5+
RUN install-php-extensions swoole
6+
7+
# RUN apk add --no-cache --virtual .build-deps $PHPIZE_DEPS && \
8+
# pecl install swoole && \
9+
# docker-php-ext-enable swoole && \
10+
# # cleanup
11+
# apk del .build-deps && \
12+
# rm -rf /var/cache/apk/* /tmp/*

8.1-swoole-nginx-prod/supervisor.conf

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
[program:nginx]
22
depends_on = octane
33
command = nginx -g "daemon off;"
4+
autorestart = true
45
stopasgroup = true
56
stderr_logfile = /dev/stderr
67
stdout_logfile = /dev/stdout
78

89
[program:octane]
9-
command = su-exec kool php artisan octane:start --server=swoole
10+
command = su-exec kool php artisan octane:start
11+
autorestart = true
1012
stopasgroup = true
1113
stderr_logfile = /dev/stderr
1214
stdout_logfile = /dev/stdout

8.1-swoole-nginx/supervisor.conf

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
[program:nginx]
22
depends_on = octane
33
command = nginx -g "daemon off;"
4+
autorestart = true
45
stopasgroup = true
56
stderr_logfile = /dev/stderr
67
stdout_logfile = /dev/stdout
78

89
[program:octane]
9-
command = su-exec kool php artisan octane:start --server=swoole --watch
10+
command = su-exec kool php artisan octane:start --watch
11+
autorestart = true
1012
stopasgroup = true
1113
stderr_logfile = /dev/stderr
1214
stdout_logfile = /dev/stdout

8.1-swoole-prod/Dockerfile

+10-6
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
11
FROM kooldev/php:8.1-prod
22

3-
RUN apk add --no-cache --virtual .build-deps $PHPIZE_DEPS && \
4-
pecl install swoole && \
5-
docker-php-ext-enable swoole && \
6-
# cleanup
7-
apk del .build-deps && \
8-
rm -rf /var/cache/apk/* /tmp/*
3+
COPY --from=mlocati/php-extension-installer /usr/bin/install-php-extensions /usr/local/bin/
4+
5+
RUN install-php-extensions swoole
6+
7+
# RUN apk add --no-cache --virtual .build-deps $PHPIZE_DEPS && \
8+
# pecl install swoole && \
9+
# docker-php-ext-enable swoole && \
10+
# # cleanup
11+
# apk del .build-deps && \
12+
# rm -rf /var/cache/apk/* /tmp/*

8.1-swoole/Dockerfile

+10-6
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
11
FROM kooldev/php:8.1-node
22

3-
RUN apk add --no-cache --virtual .build-deps $PHPIZE_DEPS && \
4-
pecl install swoole && \
5-
docker-php-ext-enable swoole && \
6-
# cleanup
7-
apk del .build-deps && \
8-
rm -rf /var/cache/apk/* /tmp/*
3+
COPY --from=mlocati/php-extension-installer /usr/bin/install-php-extensions /usr/local/bin/
4+
5+
RUN install-php-extensions swoole
6+
7+
# RUN apk add --no-cache --virtual .build-deps $PHPIZE_DEPS && \
8+
# pecl install swoole && \
9+
# docker-php-ext-enable swoole && \
10+
# # cleanup
11+
# apk del .build-deps && \
12+
# rm -rf /var/cache/apk/* /tmp/*

8.2-swoole-nginx-prod/supervisor.conf

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
[program:nginx]
22
depends_on = octane
33
command = nginx -g "daemon off;"
4+
autorestart = true
45
stopasgroup = true
56
stderr_logfile = /dev/stderr
67
stdout_logfile = /dev/stdout
78

89
[program:octane]
9-
command = su-exec kool php artisan octane:start --server=swoole
10+
command = su-exec kool php artisan octane:start
11+
autorestart = true
1012
stopasgroup = true
1113
stderr_logfile = /dev/stderr
1214
stdout_logfile = /dev/stdout

8.2-swoole-nginx/supervisor.conf

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
[program:nginx]
22
depends_on = octane
33
command = nginx -g "daemon off;"
4+
autorestart = true
45
stopasgroup = true
56
stderr_logfile = /dev/stderr
67
stdout_logfile = /dev/stdout
78

89
[program:octane]
9-
command = su-exec kool php artisan octane:start --server=swoole --watch
10+
command = su-exec kool php artisan octane:start --watch
11+
autorestart = true
1012
stopasgroup = true
1113
stderr_logfile = /dev/stderr
1214
stdout_logfile = /dev/stdout

8.2-swoole-prod/Dockerfile

+10-6
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
11
FROM kooldev/php:8.2-prod
22

3-
RUN apk add --no-cache --virtual .build-deps $PHPIZE_DEPS && \
4-
pecl install swoole && \
5-
docker-php-ext-enable swoole && \
6-
# cleanup
7-
apk del .build-deps && \
8-
rm -rf /var/cache/apk/* /tmp/*
3+
COPY --from=mlocati/php-extension-installer /usr/bin/install-php-extensions /usr/local/bin/
4+
5+
RUN install-php-extensions swoole
6+
7+
# RUN apk add --no-cache --virtual .build-deps $PHPIZE_DEPS && \
8+
# pecl install swoole && \
9+
# docker-php-ext-enable swoole && \
10+
# # cleanup
11+
# apk del .build-deps && \
12+
# rm -rf /var/cache/apk/* /tmp/*

8.2-swoole/Dockerfile

+10-6
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
11
FROM kooldev/php:8.2-node
22

3-
RUN apk add --no-cache --virtual .build-deps $PHPIZE_DEPS && \
4-
pecl install swoole && \
5-
docker-php-ext-enable swoole && \
6-
# cleanup
7-
apk del .build-deps && \
8-
rm -rf /var/cache/apk/* /tmp/*
3+
COPY --from=mlocati/php-extension-installer /usr/bin/install-php-extensions /usr/local/bin/
4+
5+
RUN install-php-extensions swoole
6+
7+
# RUN apk add --no-cache --virtual .build-deps $PHPIZE_DEPS && \
8+
# pecl install swoole && \
9+
# docker-php-ext-enable swoole && \
10+
# # cleanup
11+
# apk del .build-deps && \
12+
# rm -rf /var/cache/apk/* /tmp/*

8.3-swoole-nginx-prod/supervisor.conf

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
[program:nginx]
22
depends_on = octane
33
command = nginx -g "daemon off;"
4+
autorestart = true
45
stopasgroup = true
56
stderr_logfile = /dev/stderr
67
stdout_logfile = /dev/stdout
78

89
[program:octane]
9-
command = su-exec kool php artisan octane:start --server=swoole
10+
command = su-exec kool php artisan octane:start
11+
autorestart = true
1012
stopasgroup = true
1113
stderr_logfile = /dev/stderr
1214
stdout_logfile = /dev/stdout

8.3-swoole-nginx/supervisor.conf

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
[program:nginx]
22
depends_on = octane
33
command = nginx -g "daemon off;"
4+
autorestart = true
45
stopasgroup = true
56
stderr_logfile = /dev/stderr
67
stdout_logfile = /dev/stdout
78

89
[program:octane]
9-
command = su-exec kool php artisan octane:start --server=swoole --watch
10+
command = su-exec kool php artisan octane:start --watch
11+
autorestart = true
1012
stopasgroup = true
1113
stderr_logfile = /dev/stderr
1214
stdout_logfile = /dev/stdout

8.3-swoole-prod/Dockerfile

+10-6
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
11
FROM kooldev/php:8.3-prod
22

3-
RUN apk add --no-cache --virtual .build-deps $PHPIZE_DEPS && \
4-
pecl install swoole && \
5-
docker-php-ext-enable swoole && \
6-
# cleanup
7-
apk del .build-deps && \
8-
rm -rf /var/cache/apk/* /tmp/*
3+
COPY --from=mlocati/php-extension-installer /usr/bin/install-php-extensions /usr/local/bin/
4+
5+
RUN install-php-extensions swoole
6+
7+
# RUN apk add --no-cache --virtual .build-deps $PHPIZE_DEPS && \
8+
# pecl install swoole && \
9+
# docker-php-ext-enable swoole && \
10+
# # cleanup
11+
# apk del .build-deps && \
12+
# rm -rf /var/cache/apk/* /tmp/*

8.3-swoole/Dockerfile

+10-6
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
11
FROM kooldev/php:8.3-node
22

3-
RUN apk add --no-cache --virtual .build-deps $PHPIZE_DEPS && \
4-
pecl install swoole && \
5-
docker-php-ext-enable swoole && \
6-
# cleanup
7-
apk del .build-deps && \
8-
rm -rf /var/cache/apk/* /tmp/*
3+
COPY --from=mlocati/php-extension-installer /usr/bin/install-php-extensions /usr/local/bin/
4+
5+
RUN install-php-extensions swoole
6+
7+
# RUN apk add --no-cache --virtual .build-deps $PHPIZE_DEPS && \
8+
# pecl install swoole && \
9+
# docker-php-ext-enable swoole && \
10+
# # cleanup
11+
# apk del .build-deps && \
12+
# rm -rf /var/cache/apk/* /tmp/*

template/Dockerfile.blade.php

+10-6
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
11
FROM {{ $from }}
22

3-
RUN apk add --no-cache --virtual .build-deps $PHPIZE_DEPS && \
4-
pecl install swoole && \
5-
docker-php-ext-enable swoole && \
6-
# cleanup
7-
apk del .build-deps && \
8-
rm -rf /var/cache/apk/* /tmp/*
3+
COPY --from=mlocati/php-extension-installer /usr/bin/install-php-extensions /usr/local/bin/
4+
5+
RUN install-php-extensions swoole
6+
7+
# RUN apk add --no-cache --virtual .build-deps $PHPIZE_DEPS && \
8+
# pecl install swoole && \
9+
# docker-php-ext-enable swoole && \
10+
# # cleanup
11+
# apk del .build-deps && \
12+
# rm -rf /var/cache/apk/* /tmp/*

template/supervisor-conf.blade.php

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
[program:nginx]
22
depends_on = octane
33
command = nginx -g "daemon off;"
4+
autorestart = true
45
stopasgroup = true
56
stderr_logfile = /dev/stderr
67
stdout_logfile = /dev/stdout
78

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

0 commit comments

Comments
 (0)