Files
admin/Dockerfile
2025-09-11 23:12:47 +08:00

49 lines
1.3 KiB
Docker
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

FROM php:7.2.34-fpm-alpine3.12
ENV COMPOSER_ALLOW_SUPERUSER=1 \
COMPOSER_HOME=/composer \
COMPOSER_MEMORY_LIMIT=-1
# 使用阿里云 Alpine 3.12 存档源
RUN echo "https://mirrors.aliyun.com/alpine/v3.12/main" > /etc/apk/repositories \
&& echo "https://mirrors.aliyun.com/alpine/v3.12/community" >> /etc/apk/repositories
# 安装依赖 + 常用扩展
RUN apk add --no-cache \
bash \
curl \
wget \
unzip \
libzip-dev \
mariadb-connector-c-dev \
openssl \
openssl-dev \
pcre \
pcre-dev \
zlib \
zlib-dev \
oniguruma-dev \
autoconf \
linux-headers \
build-base \
&& docker-php-ext-install \
pdo_mysql \
mysqli \
mbstring \
opcache \
zip \
# 安装 swoole固定版本兼容 php7.2
&& pecl install swoole-4.8.12 \
&& docker-php-ext-enable swoole \
# 安装 redis 扩展(最后一个支持 php7.2 的版本)
&& pecl install redis-5.3.7 \
&& docker-php-ext-enable redis \
# 安装 composer
&& curl -sS https://getcomposer.org/installer | php -- \
--install-dir=/usr/local/bin --filename=composer \
# 清理
&& apk del build-base autoconf linux-headers \
&& rm -rf /tmp/pear ~/.pearrc /var/cache/apk/*
WORKDIR /var/www/html