Run php-cli as www-data on nginx container for compatability.

This commit is contained in:
Greyscale 2022-05-17 20:34:41 +02:00
parent 01675bf4e8
commit 8c7f3f6471
No known key found for this signature in database
GPG key ID: EF017054C3E9CD59
3 changed files with 8 additions and 0 deletions

View file

@ -29,6 +29,7 @@ COPY self-signed-certificates /certs
RUN apt-get -qq update && \
# Install pre-dependencies to use apt-key.
apt-get -yqq install --no-install-recommends \
sudo \
lsb-core \
gnupg \
&& \
@ -107,6 +108,9 @@ RUN apt-get -qq update && \
dos2unix -q /etc/service/*/run && \
# Make sure all our new services are executable
chmod +x /etc/service/*/run && \
# Insert shim for php-cli still running in this nginx container to run as www-data.
mv /conf/php-cli-user-shim.sh /usr/local/sbin/php && \
chmod +x /usr/local/sbin/php && \
# Cleanup the /conf dir
rm -R /conf && \
# Write the PHP version into some template locations

View file

@ -33,5 +33,6 @@ bake:
$(MAKE) docker-php-core bake-flavours PHP_VERSION=7.3
$(MAKE) docker-php-core bake-flavours PHP_VERSION=7.4
$(MAKE) docker-php-core bake-flavours PHP_VERSION=8.0
$(MAKE) docker-php-core bake-flavours PHP_VERSION=8.1
all: bake

View file

@ -0,0 +1,3 @@
#!/bin/sh
sudo -u www-data /usr/bin/php "$*"
return $?