-
Notifications
You must be signed in to change notification settings - Fork 41
/
Copy pathDockerfile
67 lines (57 loc) · 1.33 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
60
61
62
63
64
65
66
67
FROM composer:2 as composer_stage
RUN rm -rf /var/www && mkdir -p /var/www/html
WORKDIR /var/www/html
FROM php:8.2-fpm-alpine
# Install dev dependencies
RUN apk add --no-cache --virtual .build-deps \
$PHPIZE_DEPS \
curl-dev \
imagemagick-dev \
libtool \
libxml2-dev \
linux-headers # Add linux-headers here
# Install production dependencies
RUN apk add --no-cache \
bash \
curl \
g++ \
gcc \
git \
imagemagick \
libc-dev \
libpng-dev \
make \
yarn \
openssh-client \
rsync \
zlib-dev \
libzip-dev
# Install PECL and PEAR extensions
RUN pecl install \
imagick \
xdebug
# Workaround for iconv with PHP8
RUN apk add gnu-libiconv=1.15-r3 --update-cache --repository http://dl-cdn.alpinelinux.org/alpine/v3.13/community/ --allow-untrusted
ENV LD_PRELOAD /usr/lib/preloadable_libiconv.so
# Install and enable PHP extensions
RUN docker-php-ext-enable \
imagick \
xdebug
RUN docker-php-ext-configure zip
RUN docker-php-ext-install \
curl \
pdo \
pdo_mysql \
pcntl \
xml \
gd \
zip \
bcmath
WORKDIR /var/www/html
COPY src src/
COPY --from=composer_stage /usr/bin/composer /usr/bin/composer
COPY composer.json /var/www/html/
# Install composer dependencies
RUN composer install --no-dev --optimize-autoloader
CMD ["php-fpm"]
EXPOSE 9000