-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDockerfile
53 lines (47 loc) · 1.43 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
FROM php:8.1.18-fpm-bullseye
WORKDIR /var/www/html
# Install required packages
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
libfreetype6-dev \
libicu-dev \
libjpeg-dev \
libmagickwand-dev \
libpng-dev \
libwebp-dev \
libzip-dev \
curl \
git \
&& rm -rf /var/lib/apt/lists/*
# Install PHP extensions
RUN docker-php-ext-install -j "$(nproc)" \
pdo \
pdo_mysql \
mysqli \
bcmath \
exif \
gd \
intl \
zip \
&& docker-php-ext-configure gd \
--with-freetype \
--with-jpeg \
--with-webp \
&& set -eux; \
docker-php-ext-enable opcache; \
{ \
echo 'opcache.memory_consumption=128'; \
echo 'opcache.interned_strings_buffer=8'; \
echo 'opcache.max_accelerated_files=4000'; \
echo 'opcache.revalidate_freq=2'; \
echo 'opcache.fast_shutdown=1'; \
} > /usr/local/etc/php/conf.d/opcache-recommended.ini \
&& pecl install xdebug && docker-php-ext-enable xdebug \
&& pecl install imagick && docker-php-ext-enable imagick
# Install Composer
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
# Healthcheck
HEALTHCHECK --interval=30s --timeout=10s --retries=3 \
CMD curl --fail http://localhost:9000/fpm-ping || exit 1
# Start PHP-FPM
CMD ["php-fpm"]