-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
94 lines (81 loc) · 2.13 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
FROM php:7.4-cli-alpine3.14
RUN mv "$PHP_INI_DIR/php.ini-production" "$PHP_INI_DIR/php.ini"
# Add Repositories
RUN rm -f /etc/apk/repositories &&\
echo "http://dl-cdn.alpinelinux.org/alpine/v3.14/main" >> /etc/apk/repositories && \
echo "http://dl-cdn.alpinelinux.org/alpine/v3.14/community" >> /etc/apk/repositories
# Add Build Dependencies
RUN apk add --no-cache --virtual .build-deps \
zlib-dev \
libjpeg-turbo-dev \
libpng-dev \
libxml2-dev \
bzip2-dev \
libzip-dev \
gettext-dev
# Add Production Dependencies
RUN apk add --update --no-cache \
file \
git \
jpegoptim \
pngquant \
optipng \
autoconf \
automake \
g++ \
libtool \
libzip \
make \
texinfo \
gettext \
supervisor \
curl \
tzdata \
nano \
icu-dev \
freetype-dev \
imagemagick-dev \
imagemagick \
mysql-client
# Configure & Install Extension
RUN docker-php-ext-configure \
opcache --enable-opcache &&\
docker-php-ext-configure gd &&\
docker-php-ext-install \
opcache \
mysqli \
pdo \
pdo_mysql \
sockets \
json \
intl \
gd \
zip \
bz2 \
pcntl \
bcmath
ENV SWOOLE_VERSION=4.8.1
RUN pecl install swoole && docker-php-ext-enable swoole && \
pecl install redis && docker-php-ext-enable redis && \
pecl install imagick && docker-php-ext-enable imagick
RUN git clone https://github.com/emcrisostomo/fswatch.git /root/fswatch && \
cd /root/fswatch && \
./autogen.sh && \
./configure && \
make -j && \
make install && \
cd /root && \
rm -rf /root/fswatch
# Add Composer
RUN curl -s https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin/ --filename=composer && \
composer config -g repo.packagist composer https://mirrors.aliyun.com/composer/
ENV COMPOSER_ALLOW_SUPERUSER=1
ENV COMPOSER_MEMORY_LIMIT=-1
ENV PATH="./vendor/bin:$PATH"
# Remove Build Dependencies
RUN apk del -f .build-deps && \
cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && \
echo 'Asia/Shanghai' > /etc/timezone
# Setup Working Dir
WORKDIR /var/www/html
CMD ["/usr/bin/supervisord"]