-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDockerfile
67 lines (59 loc) · 1.88 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
FROM php:8.1
MAINTAINER twosee <[email protected]>
# install modules : GD iconv
RUN apt-get update && apt-get install -y \
procps \
libpng-dev \
openssl \
libssh-dev \
libpcre3 \
libpcre3-dev \
libnghttp2-dev \
libhiredis-dev \
curl \
wget \
zip \
unzip \
git && \
apt autoremove && apt clean
# install php pdo_mysql opcache
# WARNING: Disable opcache-cli if you run you php
RUN docker-php-ext-install \
iconv \
gd \
pdo_mysql \
mysqli \
sockets \
pcntl
#install redis
RUN pecl install redis && docker-php-ext-enable redis
# install composer
ENV COMPOSER_ALLOW_SUPERUSER 1
RUN curl -sS https://getcomposer.org/installer | php && \
mv composer.phar /usr/local/bin/composer && \
composer self-update --clean-backups
# install swoole
#TIP: it always get last stable version of swoole coroutine.
RUN cd /root && \
curl -o /tmp/swoole-releases https://github.com/swoole/swoole-src/releases -L && \
cat /tmp/swoole-releases | grep 'href=".*archive.*.tar.gz"' | head -1 | \
awk -F '"' ' {print "curl -o /tmp/swoole.tar.gz https://github.com"$2" -L" > "/tmp/swoole.download"}' && \
sh /tmp/swoole.download && \
tar zxvf /tmp/swoole.tar.gz && cd swoole-src* && \
phpize && \
./configure \
--enable-coroutine \
--enable-sockets \
--enable-openssl \
--enable-http2 \
--enable-async-redis \
--enable-mysqlnd && \
make && make install && \
docker-php-ext-enable swoole && \
echo "swoole.fast_serialize=On" >> /usr/local/etc/php/conf.d/docker-php-ext-swoole-serialize.ini && \
rm -rf /tmp/*
# set China timezone
RUN /bin/cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && \
echo 'Asia/Shanghai' > /etc/timezone && \
echo "[Date]\ndate.timezone=Asia/Shanghai" > /usr/local/etc/php/conf.d/timezone.ini
WORKDIR /app/