Skip to content

Commit e6cf59d

Browse files
authored
Merge pull request #54 from flownative/task/adjust-termination-handling
Adjust termination handling
2 parents 032f328 + ef4e916 commit e6cf59d

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

Dockerfile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,10 @@ RUN export FLOWNATIVE_LOG_PATH_AND_FILENAME=/dev/stdout \
3939
USER 1000
4040
EXPOSE 9000 9001
4141

42+
# terminate with SIGQUIT which is handled gracefully by php-fpm
43+
# contrary to SIGTERM which terminates php-fpm immediately.
44+
STOPSIGNAL SIGQUIT
45+
4246
WORKDIR ${PHP_BASE_PATH}
4347
ENTRYPOINT [ "/entrypoint.sh" ]
4448
CMD [ "run" ]

root-files/opt/flownative/php/etc/php-fpm.conf.template

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,11 @@ pid = ${PHP_TMP_PATH}/php-fpm.pid
77
; the shell running php-fpm.sh, so we can wait for it with "wait":
88
daemonize = no
99

10+
; tell the child processes to wait for 5s before executing the signal
11+
; received from the parent process, to make the php-fpm container
12+
; terminate gracefully:
13+
process_control_timeout = 5
14+
1015
[www]
1116

1217
access.log = ${PHP_FPM_ACCESS_LOG_PATH}

0 commit comments

Comments
 (0)