-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.7.4-zts
66 lines (60 loc) · 2.4 KB
/
Dockerfile.7.4-zts
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
FROM php:7.4-zts-alpine
# 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 \
libmcrypt-dev \
libxml2-dev \
imagemagick6-dev \
libmemcached-dev \
libwebp-dev libjpeg-turbo-dev libpng-dev \
freetype-dev yaml-dev zlib-dev \
tzdata \
libzip \
&& 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 \
&& pecl install yaml \
&& pecl install zip \
&& docker-php-ext-install bcmath \
mysqli pcntl pdo_mysql shmop soap sockets sysvsem xmlrpc opcache zip \
&& docker-php-ext-configure gd --with-webp-dir=/usr/include/webp --with-jpeg-dir=/usr/include --with-png-dir=/usr/include --with-freetype-dir=/usr/include/freetype2 \
&& pecl install imagick \
&& pecl install memcached \
&& pecl install mongodb \
&& docker-php-ext-enable redis \
&& docker-php-ext-enable apcu \
&& docker-php-ext-enable protobuf \
&& docker-php-ext-enable yaml \
&& docker-php-ext-enable zip \
&& docker-php-ext-enable imagick \
&& docker-php-ext-enable memcached \
&& docker-php-ext-enable mongodb \
&& cd /tmp && wget https://github.com/pmmp/pthreads/archive/fork.zip && uzip fork.zip && cd pthreads-fork && phpize && ./configure && make && make install && docker-php-ext-enable pthreads \
# 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