This commit is contained in:
rainerosion 2023-02-07 01:14:30 +08:00
parent 95b99a935b
commit 31f84d771a
2 changed files with 70 additions and 6 deletions

View File

@ -1,6 +1,9 @@
FROM php:8.1.15-fpm-alpine3.17
FROM composer:latest as composer-build
COPY --from=composer:latest /usr/bin/composer /usr/bin/composer
FROM php:8.1.15-fpm-alpine3.17
MAINTAINER rainerosion "admin@rainss.cn"
COPY --from=composer-build /usr/bin/composer /usr/bin/composer
COPY Caddyfile /etc/caddy/Caddyfile
ENV BUILD_DEPS \
libzip-dev \
@ -12,10 +15,12 @@ ENV BUILD_DEPS \
curl-dev \
sqlite-dev \
oniguruma-dev \
memcached-dev
libmemcached-dev
ENV RUN_DEPS \
autoconf \
g++ \
make \
libzip \
icu \
postgresql-libs \
@ -25,7 +30,7 @@ ENV RUN_DEPS \
curl \
sqlite-libs \
oniguruma \
memcached
libmemcached
ENV PHP_EXTENSIONS \
zip \
@ -49,6 +54,6 @@ RUN set -eux && \
apk add --no-cache --virtual .build-deps $BUILD_DEPS && \
docker-php-ext-configure gd --enable-gd --with-jpeg --with-webp && \
docker-php-ext-install -j $(nproc) $PHP_EXTENSIONS && \
# pecl install redis memcached && \
# docker-php-ext-enable redis memcached && \
pecl install redis memcached && \
docker-php-ext-enable redis memcached && \
apk del .build-deps

View File

@ -0,0 +1,59 @@
FROM --platform=$TARGETPLATFORM composer:latest as composer-build
FROM --platform=$TARGETPLATFORM php:8.1.15-fpm-alpine3.17
MAINTAINER rainerosion "admin@rainss.cn"
COPY --from=composer-build /usr/bin/composer /usr/bin/composer
COPY Caddyfile /etc/caddy/Caddyfile
ENV BUILD_DEPS \
libzip-dev \
icu-dev \
postgresql-dev \
libpng-dev \
libwebp-dev \
libjpeg-turbo-dev \
curl-dev \
sqlite-dev \
oniguruma-dev \
libmemcached-dev
ENV RUN_DEPS \
autoconf \
g++ \
make \
libzip \
icu \
postgresql-libs \
libpng \
libwebp \
libjpeg-turbo \
curl \
sqlite-libs \
oniguruma \
libmemcached
ENV PHP_EXTENSIONS \
zip \
intl \
exif \
pdo_mysql \
pdo_pgsql \
mysqli \
pgsql \
gd \
curl \
session \
pdo_sqlite \
fileinfo \
mbstring
RUN set -eux && \
sed -i 's/dl-cdn.alpinelinux.org/mirrors.ustc.edu.cn/g' /etc/apk/repositories && \
apk update && \
apk add --no-cache $RUN_DEPS && \
apk add --no-cache --virtual .build-deps $BUILD_DEPS && \
docker-php-ext-configure gd --enable-gd --with-jpeg --with-webp && \
docker-php-ext-install -j $(nproc) $PHP_EXTENSIONS && \
pecl install redis memcached && \
docker-php-ext-enable redis memcached && \
apk del .build-deps