-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
59 lines (51 loc) · 1.23 KB
/
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
FROM php:8.1.5-fpm-alpine as php
ARG UID=1000
ARG GID=1000
ARG PHPREDIS_VERSION=5.3.7
RUN apk update && apk add --no-cache \
vim \
curl \
git \
npm \
libzip \
libpq \
libgomp \
libjpeg-turbo \
libpng \
freetype
RUN apk update && apk add --virtual .ext-deps \
# pdo_pgsql deps
postgresql-dev \
# gd deps
freetype-dev \
libjpeg-turbo-dev \
libwebp-dev \
libpng-dev \
# zip deps
libzip-dev \
# install phpredis from github
&& mkdir -p /usr/src/php/ext/redis \
&& curl -L https://github.com/phpredis/phpredis/archive/$PHPREDIS_VERSION.tar.gz | tar xvz -C /usr/src/php/ext/redis --strip 1 \
&& echo 'redis' >> /usr/src/php-available-exts \
# install extensions
&& docker-php-ext-install -j "$(nproc)" \
zip \
pdo \
pdo_pgsql \
opcache \
bcmath \
sockets \
redis \
gd \
exif \
&& apk del .ext-deps \
&& rm -rf /var/cache/apk/*
RUN addgroup -S php -g $GID \
&& adduser -u $UID -S -G php php \
&& mkdir /app \
&& chown php:php /app
COPY --from=composer:2.2 /usr/bin/composer /usr/bin/composer
COPY php.ini /usr/local/etc/php/conf.d/
COPY php-fpm.conf /usr/local/etc/php-fpm.d/www.conf
WORKDIR /app
USER php