-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
50 lines (45 loc) · 1.75 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
ARG PHP_TAG=8.2.21-cli-alpine
ARG COMPOSER_TAG=2
FROM composer:${COMPOSER_TAG} as composer
FROM php:${PHP_TAG}
RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.tencent.com/g' /etc/apk/repositories
RUN set -ex; \
apk add --no-cache \
postgresql-dev \
libzip-dev bzip2-dev \
libpng-dev libjpeg-turbo-dev freetype-dev \
linux-headers \
icu-dev; \
docker-php-ext-configure gd --with-jpeg=/usr/include/ --with-freetype=/usr/include/; \
docker-php-ext-install -j$(nproc) \
opcache pcntl \
mysqli pdo_mysql pdo_pgsql \
zip bz2 \
gd sockets \
intl bcmath \
calendar; \
apk del linux-headers
ARG REDIS_VERSION=6.0.2
ARG MONGODB_VERSION=1.19.3
ARG SWOOLE_VERSION=5.1.3
RUN set -ex; \
apk add --no-cache --virtual .build-deps $PHPIZE_DEPS; \
# redis
mkdir /tmp/redis; \
curl -k https://oss.bytes.us.to/archives/pecl.php.net/get/redis-${REDIS_VERSION}.tgz | tar -xz --strip-components=1 -C /tmp/redis; \
docker-php-ext-install -j$(nproc) /tmp/redis; \
rm -rf /tmp/redis; \
# mongodb
mkdir /tmp/mongodb; \
curl -k https://oss.bytes.us.to/archives/pecl.php.net/get/mongodb-${MONGODB_VERSION}.tgz | tar -xz --strip-components=1 -C /tmp/mongodb; \
docker-php-ext-install -j$(nproc) /tmp/mongodb; \
rm -rf /tmp/mongodb; \
# swoole
mkdir /tmp/swoole; \
curl -k https://oss.bytes.us.to/archives/pecl.php.net/get/swoole-${SWOOLE_VERSION}.tgz | tar -xz --strip-components=1 -C /tmp/swoole; \
apk add --no-cache openssl-dev curl-dev; \
docker-php-ext-configure /tmp/swoole --enable-openssl --enable-swoole-curl; \
docker-php-ext-install -j$(nproc) /tmp/swoole; \
rm -rf /tmp/swoole; \
apk del .build-deps $PHPIZE_DEPS
COPY --from=composer /usr/bin/composer /usr/local/bin/composer