Skip to content

Commit 4697568

Browse files
Use update-alternatives to set a friendly php-fpm path
1 parent 5ad5099 commit 4697568

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

Dockerfile

+4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
ARG debian_version
22
FROM debian:${debian_version}
33

4+
ARG php_version
45
ARG userid=3000
56
ARG groupid=3000
67

@@ -73,6 +74,9 @@ COPY etc/supervisord.d /etc/supervisord.d
7374
COPY etc/php-fpm/php-fpm.conf /etc/php-fpm.conf
7475
COPY etc/php.d/60-craftcms.ini /etc/php.d/60-craftcms.ini
7576

77+
# set a friendly path for php-fpm that does not have the version
78+
RUN update-alternatives --install /usr/sbin/php-fpm php-fpm /usr/sbin/php-fpm${php_version} 1
79+
7680
# set the sockets and pid files to be writable by the appuser
7781
RUN mkdir -p /var/run/php && touch /var/run/php/php-fpm.sock && chown -R appuser:appgroup /var/run/php
7882

etc/supervisord.d/php-fpm.ini

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[program:php-fpm]
2-
command=/usr/sbin/php-fpm8.2 --fpm-config /etc/php-fpm.conf
2+
command=/usr/sbin/php-fpm --fpm-config /etc/php-fpm.conf
33
user=appuser
44
stdout_logfile=/dev/stdout
55
stdout_logfile_maxbytes=0

0 commit comments

Comments
 (0)