-
Notifications
You must be signed in to change notification settings - Fork 40
Expand file tree
/
Copy pathDockerfile
More file actions
71 lines (59 loc) · 1.49 KB
/
Dockerfile
File metadata and controls
71 lines (59 loc) · 1.49 KB
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
FROM composer:2 as composer_stage
RUN rm -rf /var/www && mkdir -p /var/www/html
WORKDIR /var/www/html
FROM php:8.1.6RC1-fpm-alpine3.15
# Install and update linux headers
RUN apk add --update linux-headers
# Install dev dependencies
RUN apk add --no-cache --virtual .build-deps \
$PHPIZE_DEPS \
curl-dev \
imagemagick-dev \
libtool \
libxml2-dev
# 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
# We currently can't natively pull iconv with PHP8, see: https://github.com/docker-library/php/issues/240#issuecomment-876464325
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/
# This are production settings, I'm running with 'no-dev', adjust accordingly
# if you need it
RUN composer install
CMD ["php-fpm"]
EXPOSE 9000