forked from aschmelyun/docker-compose-laravel
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathphp.dockerfile
27 lines (18 loc) · 865 Bytes
/
php.dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
FROM php:8-fpm-alpine
ARG PHPGROUP
ARG PHPUSER
ENV PHPGROUP=${PHPGROUP}
ENV PHPUSER=${PHPUSER}
RUN addgroup --system ${PHPGROUP}; exit 0
RUN adduser --system -G ${PHPGROUP} -s /bin/sh -D ${PHPUSER}; exit 0
RUN mkdir -p /var/www/html
WORKDIR /var/www/html
RUN sed -i "s/user = www-data/user = ${PHPUSER}/g" /usr/local/etc/php-fpm.d/www.conf
RUN sed -i "s/group = www-data/group = ${PHPGROUP}/g" /usr/local/etc/php-fpm.d/www.conf
RUN echo "php_admin_flag[log_errors] = on" >> /usr/local/etc/php-fpm.d/www.conf
RUN docker-php-ext-install pdo pdo_mysql
RUN mkdir -p /usr/src/php/ext/redis \
&& curl -L https://github.com/phpredis/phpredis/archive/5.3.4.tar.gz | tar xvz -C /usr/src/php/ext/redis --strip 1 \
&& echo 'redis' >> /usr/src/php-available-exts \
&& docker-php-ext-install redis
CMD ["php-fpm", "-y", "/usr/local/etc/php-fpm.conf", "-R"]