-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
76 lines (67 loc) · 2.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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
FROM php:8.3.14-fpm-alpine
# opcache
RUN set -eux; \
docker-php-ext-install opcache
# mysqli (deprecated)
RUN set -eux; \
docker-php-ext-install mysqli
# gd
RUN set -eux; \
apk add --no-cache freetype libjpeg-turbo libpng; \
apk add --no-cache --virtual .deps freetype-dev libjpeg-turbo-dev libpng-dev; \
docker-php-ext-configure gd \
--with-freetype=/usr/include/ \
--with-jpeg=/usr/include/; \
docker-php-ext-install gd; \
docker-php-source delete; \
apk del .deps
# PDO: mysql driver
RUN set -eux; \
docker-php-ext-install pdo pdo_mysql
# PDO: pgsql driver
# See: https://github.com/docker-library/php/issues/221
RUN set -eux; \
apk add --no-cache postgresql-libs; \
apk add --no-cache --virtual .deps postgresql-dev; \
docker-php-ext-install pdo_pgsql; \
apk del .deps
# memcached
# See: https://stackoverflow.com/questions/40894385/how-can-i-install-the-php-memcached-extension-on-dockers-php7-alpine-image
RUN set -eux; \
apk add --no-cache libmemcached-libs zlib; \
apk add --no-cache --virtual .phpize-deps $PHPIZE_DEPS; \
apk add --no-cache --virtual .deps zlib-dev libmemcached-dev cyrus-sasl-dev; \
pecl install memcached; \
echo "extension=memcached.so" > /usr/local/etc/php/conf.d/20_memcached.ini; \
docker-php-source delete; \
apk del .deps; \
apk del .phpize-deps;
# Sockets
# See: https://github.com/docker-library/php/issues/181#issuecomment-173365852
RUN set -eux; \
apk add --no-cache --virtual .deps linux-headers; \
docker-php-ext-install sockets; \
apk del .deps
# Xdebug: https://stackoverflow.com/questions/46825502/how-do-i-install-xdebug-on-dockers-official-php-fpm-alpine-image
# PHPIZE_DEPS: autoconf dpkg-dev dpkg file g++ gcc libc-dev make pkgconf re2c
RUN set -eux; \
apk add --no-cache --virtual .build-dependencies $PHPIZE_DEPS; \
apk add --no-cache --virtual .deps linux-headers; \
pecl install xdebug-3.3.1; \
docker-php-ext-enable xdebug; \
docker-php-source delete; \
apk del .deps; \
apk del .build-dependencies
RUN set -eux; \
{ \
echo "[xdebug]"; \
echo "zend_extension=xdebug"; \
echo "xdebug.mode=debug"; \
echo "xdebug.start_with_request=yes"; \
echo "xdebug.client_host=host.docker.internal"; \
echo "xdebug.client_port=9000"; \
} > /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini;
RUN set -eux; \
echo; \
php -i; \
php -m