-
Notifications
You must be signed in to change notification settings - Fork 2
/
Dockerfile
100 lines (97 loc) · 3.36 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
FROM php:fpm-alpine3.18
# docker build -t bscheshir/php:fpm-alpine-4yii2-xdebug --pull -- .
MAINTAINER BSCheshir <bscheshir.work@gmail.com>
# Install system packages & PHP extensions required for Yii 2.0 Framework
RUN apk --update add \
git \
curl \
curl-dev \
bash \
bash-completion \
oniguruma-dev \
libzip-dev \
freetype-dev \
icu \
icu-dev \
libxml2-dev \
libintl \
libjpeg-turbo-dev \
libpng-dev \
mysql-client \
nodejs \
postgresql-dev && \
docker-php-ext-configure gd \
--with-freetype \
--with-jpeg && \
docker-php-ext-configure bcmath && \
docker-php-ext-configure pgsql --with-pgsql=/usr/local/pgsql && \
docker-php-ext-install \
soap \
zip \
curl \
bcmath \
exif \
gd \
intl \
mbstring \
opcache \
pdo_mysql \
pdo_pgsql \
pgsql && \
apk del \
icu-dev \
gcc \
g++ && \
apk add --no-cache tzdata && \
set -ex && \
# memcache
apk add --no-cache --virtual .memcached-deps zlib-dev libmemcached-dev cyrus-sasl-dev && \
docker-php-source extract && \
git clone https://github.com/php-memcached-dev/php-memcached /usr/src/php/ext/memcached/ && \
docker-php-ext-install memcached && \
# docker-php-source delete && \
apk add --no-cache --virtual .memcached-runtime-deps libmemcached-libs && \
apk del .memcached-deps && \
# imagick
printf "\n%s\n%s" "@edge http://dl-cdn.alpinelinux.org/alpine/edge/main" "@testing http://dl-cdn.alpinelinux.org/alpine/edge/testing" >> /etc/apk/repositories && \
apk --update add imagemagick-dev@edge imagemagick@edge && \
apk add --no-cache --virtual .phpize-deps $PHPIZE_DEPS libtool && \
export CFLAGS="$PHP_CFLAGS" CPPFLAGS="$PHP_CPPFLAGS" LDFLAGS="$PHP_LDFLAGS" && \
pecl install imagick-3.5.0 && \
docker-php-ext-enable imagick && \
# apk del .phpize-deps && \
# apcu
# apk add --no-cache --virtual .phpize-deps $PHPIZE_DEPS && \
# docker-php-source extract && \
pecl install apcu && \
docker-php-ext-enable apcu && \
docker-php-source delete && \
apk del .phpize-deps && \
rm -r /tmp/pear/* && \
echo -e "expose_php = off\n\
upload_max_filesize = 5M\n\
apc.enable_cli = 1\n\
opcache.optimization_level=0x7FFFBBFF\n\
cgi.fix_pathinfo = 0" >> /usr/local/etc/php/php.ini
# Convert PSR-0/4 autoloading to classmap to get a faster autoloader.
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer && \
composer global require --optimize-autoloader
# xdebug
ENV XDEBUG_VERSION 3.2.2
ENV XDEBUG_MODE=debug
RUN apk add --no-cache --virtual .build-deps $PHPIZE_DEPS linux-headers && \
pecl install xdebug-$XDEBUG_VERSION && \
docker-php-ext-enable xdebug && \
apk del -f .build-deps && \
rm -r /tmp/pear/* && \
echo -e "xdebug.discover_client_host=false\n\
xdebug.start_with_request=trigger\n\
xdebug.trigger_value=PHPSTORM\n\
xdebug.client_host=host.docker.internal\n\
xdebug.var_display_max_data=1024\n\
xdebug.var_display_max_depth=5\
" >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini && \
echo -e "#!/usr/bin/env sh\n\
/usr/bin/env php -dxdebug.start_with_request=yes \"$@\"\
" >> /usr/bin/dphp && \
chmod +x /usr/bin/dphp