-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile_phpfpm_local
80 lines (60 loc) · 1.79 KB
/
Dockerfile_phpfpm_local
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
FROM php:8.2-fpm-alpine
COPY certificates/adp_rootca.crt /usr/local/share/ca-certificates/adp_rootca.crt
RUN update-ca-certificates --fresh
RUN apk update && apk upgrade
RUN apk add \
icu-dev \
postgresql-dev \
libzip-dev \
libxml2-dev \
libmcrypt-dev \
zlib-dev \
freetype-dev \
libpng-dev \
libjpeg-turbo-dev \
jpeg-dev \
libreoffice \
imagemagick-dev \
libxslt \
libxslt-dev \
yarn
RUN docker-php-ext-install \
pdo_pgsql \
opcache \
zip \
soap \
intl \
gd \
xsl
RUN docker-php-ext-configure \
gd \
--with-freetype \
--with-jpeg
RUN docker-php-ext-enable xsl
RUN apk add --no-cache --virtual .build-deps \
build-base \
autoconf
RUN apk del -f .build-deps
COPY docker-phpfpm/php-ini-overrides.ini /usr/local/etc/php/conf.d/
COPY docker-phpfpm/www.conf /usr/local/etc/php-fpm.d
# Install dependencies and xdebug in one layer
RUN apk --no-cache add pcre-dev ${PHPIZE_DEPS} \
&& apk add --update linux-headers \
&& pecl install xdebug-3.3.0 && docker-php-ext-enable xdebug \
&& apk del pcre-dev ${PHPIZE_DEPS}
# Copy the Xdebug configuration file
COPY ./docker-phpfpm/xdebug.ini /usr/local/etc/php/conf.d/xdebug.ini
RUN php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
RUN php composer-setup.php --install-dir=/usr/local/bin --filename=composer
RUN php -r "unlink('composer-setup.php');"
RUN chown www-data: /var/www
USER www-data
RUN mkdir -p /var/www/var/cache
RUN mkdir -p /var/www/public/localworkingstorage/dossier
WORKDIR /var/www
COPY --chown=www-data . /var/www
RUN composer install --prefer-dist --no-progress --no-suggest --no-scripts
RUN yarn --ignore-scripts --ignore-platform
RUN yarn encore prod
RUN yarn run postinstall
CMD ["/var/www/docker-entrypoint_phpfpm.sh"]