-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.8.0-fpm
68 lines (62 loc) · 2.64 KB
/
Dockerfile.8.0-fpm
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
FROM php:8-fpm-alpine3.14
# WORKDIR /var/www/html
# use mirror tsinghua
# RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.tuna.tsinghua.edu.cn/g' /etc/apk/repositories
RUN apk update \
&& apk add --no-cache gd-dev libpng-dev \
openssl-dev \
libmcrypt-dev \
libxml2-dev \
libzip-dev \
imagemagick6-dev \
libmemcached-dev \
libwebp-dev libjpeg-turbo-dev libpng-dev \
freetype-dev curl-dev \
tzdata \
&& ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime \
&& echo "Asia/Shanghai" > /etc/timezone
RUN set -xe \
&& apk add --no-cache --virtual .build-deps \
$PHPIZE_DEPS \
&& export CFLAGS="$PHP_CFLAGS" \
CPPFLAGS="$PHP_CPPFLAGS" \
LDFLAGS="$PHP_LDFLAGS" \
&& pecl install redis \
&& pecl install apcu \
# && pecl install protobuf \
&& docker-php-ext-install bcmath \
mysqli pcntl pdo_mysql shmop soap sockets sysvsem opcache zip \
&& docker-php-ext-configure gd --with-libdir=/usr/include --with-webp --with-jpeg --with-freetype \
&& docker-php-ext-install gd \
&& pecl install imagick \
&& pecl install memcached \
&& pecl install mongodb \
# && pecl install xdebug \
&& docker-php-ext-enable redis \
&& docker-php-ext-enable apcu \
# && docker-php-ext-enable protobuf \
&& docker-php-ext-enable imagick \
&& docker-php-ext-enable memcached \
&& docker-php-ext-enable mongodb \
&& pecl install -D 'enable-sockets="yes" enable-openssl="yes" enable-http2="yes" enable-mysqlnd="yes" enable-swoole-json="yes" enable-swoole-curl="yes" enable-cares="yes"' swoole \
# && cd /tmp && pecl download swoole-4.8.5 && tar xzvf swoole-4.8.5.tgz && cd swoole-4.8.5 && phpize && ./configure --enable-sockets --enable-openssl --enable-mysqlnd --enable-swoole-json && make && make install
&& docker-php-ext-enable swoole \
&& echo "swoole.use_shortname=off" >> /usr/local/etc/php/conf.d/docker-php-ext-swoole.ini \
# Chane TimeZone
&& cp $PHP_INI_DIR/php.ini-development $PHP_INI_DIR/php.ini \
# && cp $PHP_INI_DIR/php.ini-production $PHP_INI_DIR/php.ini \
&& sed -i 's/;date.timezone =/date.timezone = "Asia\/Shanghai"/g' $PHP_INI_DIR/php.ini \
\
&& runDeps="$( \
scanelf --needed --nobanner --format '%n#p' --recursive /usr/local \
| tr ',' '\n' \
| sort -u \
| awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \
)" \
&& apk add --no-cache --virtual .php-rundeps $runDeps \
\
&& apk del .build-deps \
&& rm /tmp/* -rf
# install composer
RUN curl -sS https://getcomposer.org/installer | php \
&& mv composer.phar /usr/local/bin/composer