Browse Source

Update: Change Dockerfile check version && Change variable PHP_USER_GROUP to USER_GROUP

master
Siroco 8 months ago
parent
commit
556c41ff19
Signed by: siroco
GPG Key ID: 1324098302A514B0
  1. 2
      .env.example
  2. 20
      Dockerfile
  3. 2
      README.md
  4. 2
      docker-compose.yml

2
.env.example

@ -1 +1 @@
PHP_USER_GROUP=1001:1000
USER_GROUP=1001:1000

20
Dockerfile

@ -1,21 +1,19 @@
FROM registry.sindominio.net/debian
ARG PHP_VERSION=none
RUN apt-get update
RUN apt-get -qy install php-fpm
RUN export PHP_VERSION=`dpkg -s php-fpm | grep Version | cut -f2 -d" " | cut -d":" -f2 | cut -d"+" -f1`
COPY php-fpm.conf /etc/php/$PHP_VERSION/fpm/php-fpm.conf
RUN echo $PHP_VERSION
RUN apt-get -qy install php-fpm
RUN echo "include=/etc/php/$PHP_VERSION/fpm/pool.d/*.conf" >> /etc/php/$PHP_VERSION/fpm/php-fpm.conf
RUN dpkg -s php-fpm | grep Version | cut -f2 -d" " | cut -d":" -f2 | cut -d"+" -f1 > /tmp/php-fpm.version
COPY www.conf /etc/php/$PHP_VERSION/fpm/pool.d/www.conf
COPY *.conf /tmp/
RUN ln -s /usr/sbin/php-fpm$PHP_VERSION /usr/sbin/php-fpm
RUN PHP_VERSION=$(cat /tmp/php-fpm.version) && \
cp /tmp/php-fpm.conf /etc/php/$PHP_VERSION/fpm/php-fpm.conf && \
echo "include=/etc/php/$PHP_VERSION/fpm/pool.d/*.conf" >> /etc/php/$PHP_VERSION/fpm/php-fpm.conf && \
cp /tmp/www.conf /etc/php/$(cat /tmp/php-fpm.version)/fpm/pool.d/www.conf && \
ln -s /usr/sbin/php-fpm$PHP_VERSION /usr/sbin/php-fpm && \
rm -rf /tmp/*.conf
EXPOSE 9000

2
README.md

@ -10,7 +10,7 @@ cp .env.example .env
Modify variables:
* PHP_USER_GROUP : Specify user and group PHP
* USER_GROUP : Specify user and group PHP
Build:

2
docker-compose.yml

@ -5,4 +5,4 @@ services:
build: .
image: registry.sindominio.net/php-fpm
restart: always
user: ${PHP_USER_GROUP}
user: ${USER_GROUP}

Loading…
Cancel
Save