-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
118 lines (108 loc) · 3.49 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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
ARG PHP_VERSION
ARG PHP_SHORT_VERSION
ARG XDEBUG_VERSION
FROM php:$PHP_VERSION-fpm-alpine
# Make it usable after FROM
ARG PHP_SHORT_VERSION
ARG XDEBUG_VERSION
COPY config/memory-limit.ini $PHP_INI_DIR/conf.d/
RUN set -xe
RUN apk add --no-cache \
bash \
coreutils \
ed \
freetype \
git \
gzip \
icu \
libjpeg-turbo \
libltdl \
libmcrypt \
libpng \
libxml2 \
libzip \
msmtp \
mysql-client \
unzip \
wget \
grep
RUN apk add --no-cache --virtual .sd-build-deps \
autoconf \
build-base \
libtool
RUN apk add --no-cache --virtual .sd-persistent-deps \
freetype-dev \
icu-dev \
imap-dev \
libc-dev \
libjpeg-turbo-dev \
libmcrypt-dev \
oniguruma-dev \
libpng-dev \
libxml2-dev \
libxml2-utils \
libzip-dev \
pcre-dev \
pkgconf \
libwebp-dev \
postgresql-dev \
postgresql
# Fix iconv (see comments in the linked issue)
# Previously https://github.com/docker-library/php/issues/240#issuecomment-305038173 now 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
RUN docker-php-ext-configure bcmath --enable-bcmath
RUN docker-php-ext-configure calendar --enable-calendar
RUN docker-php-ext-configure iconv
RUN docker-php-ext-configure imap --with-imap
RUN docker-php-ext-configure intl --enable-intl
RUN docker-php-ext-configure pcntl --enable-pcntl
RUN docker-php-ext-configure pdo_mysql --with-pdo-mysql
RUN docker-php-ext-configure pgsql --with-pgsql
RUN docker-php-ext-configure mbstring --enable-mbstring
RUN docker-php-ext-configure shmop --enable-shmop
RUN docker-php-ext-configure soap --enable-soap
RUN docker-php-ext-configure sysvshm --enable-sysvshm
RUN docker-php-ext-configure xml --enable-xml
RUN if [ $(echo " $PHP_SHORT_VERSION >= 74" | bc) -eq 1 ]; then \
docker-php-ext-configure gd \
--with-freetype=/usr/include/ \
--with-jpeg=/usr/include/ \
--with-webp=/usr/include/ \
&& docker-php-ext-configure zip --with-zip; \
else \
docker-php-ext-configure gd \
--with-gd \
--with-freetype-dir=/usr/include/ \
--with-jpeg-dir=/usr/include/ \
--with-png-dir=/usr/include/ \
--with-webp-dir=/usr/include/ \
&& docker-php-ext-configure zip --enable-zip --with-libzip; \
fi
RUN docker-php-ext-install bcmath
RUN docker-php-ext-install calendar
RUN docker-php-ext-install exif
RUN docker-php-ext-install fileinfo
RUN docker-php-ext-install gd
RUN docker-php-ext-install iconv
RUN docker-php-ext-install imap
RUN docker-php-ext-install intl
RUN if [ $(echo " $PHP_SHORT_VERSION <= 74" | bc) -eq 1 ]; then \
docker-php-ext-install json; \
fi
RUN docker-php-ext-install mbstring
RUN docker-php-ext-install mysqli
RUN docker-php-ext-install pcntl
RUN docker-php-ext-install pdo_mysql
RUN docker-php-ext-install pgsql
RUN docker-php-ext-install posix
RUN docker-php-ext-install shmop
RUN docker-php-ext-install soap
RUN docker-php-ext-install sysvshm
RUN docker-php-ext-install xml
RUN docker-php-ext-install zip
RUN pecl install redis xdebug-$XDEBUG_VERSION
RUN docker-php-ext-enable opcache redis
RUN ln -sf /usr/bin/msmtp /usr/sbin/sendmail
RUN apk del .sd-build-deps \
&& rm -rf /tmp/*