-
Notifications
You must be signed in to change notification settings - Fork 2
/
Dockerfile
131 lines (126 loc) · 4.17 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
119
120
121
122
123
124
125
126
127
128
129
130
131
FROM php:fpm-alpine3.18
# docker build -t bscheshir/php:fpm-alpine-4yii2-supervisor-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
# supervisor
RUN apk add --no-cache \
supervisor&& \
mkdir /etc/supervisord.d && \
mkdir -p /var/log/supervisor && \
echo -e "[unix_http_server]\n\
file = /tmp/supervisor.sock\n\
chmod = 0777\n\
chown= nobody:nogroup\n\
\n\
[supervisord]\n\
logfile=/var/log/supervisor/supervisord.log\n\
logfile_maxbytes = 50MB\n\
logfile_backups=10\n\
loglevel = info\n\
pidfile = /tmp/supervisord.pid\n\
nodaemon = true\n\
umask = 022\n\
identifier = supervisor\n\
\n\
[supervisorctl]\n\
serverurl = unix:///tmp/supervisor.sock\n\
\n\
[rpcinterface:supervisor]\n\
supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface\n\
\n\
[include]\n\
files = /etc/supervisor/conf.d/*.conf" >> /etc/supervisord.conf
ENTRYPOINT ["supervisord", "--nodaemon", "--configuration", "/etc/supervisord.conf"]