php70 dockerfile优化

This commit is contained in:
许 洋 2026-03-04 16:09:56 +08:00
parent 90016ae06c
commit 6205d75c09
2 changed files with 17 additions and 1 deletions

View File

@ -87,7 +87,7 @@ services:
build: build:
context: ./services/php70 context: ./services/php70
args: args:
PHP_VERSION: harbor.gaore.com/tools/php-7.0.5-fpm PHP_VERSION: docker.xuanyuan.me/library/php:7.0.33-fpm-alpine
CONTAINER_PACKAGE_URL: ${CONTAINER_PACKAGE_URL} CONTAINER_PACKAGE_URL: ${CONTAINER_PACKAGE_URL}
PHP_EXTENSIONS: ${PHP70_EXTENSIONS} PHP_EXTENSIONS: ${PHP70_EXTENSIONS}
TZ: "$TZ" TZ: "$TZ"

View File

@ -23,6 +23,22 @@ RUN apk add --no-cache openssl && apk --no-cache add libzip-dev \
&& docker-php-ext-install zip && docker-php-ext-install zip
RUN apk update && apk --no-cache add shadow RUN apk update && apk --no-cache add shadow
# 配置 Composer 使用系统 CA 证书
RUN mkdir -p /var/www/.config/composer && \
mkdir -p /var/www/.cache/composer && \
chmod -R 755 /var/www/.config /var/www/.cache
# 设置 Composer 环境变量
ENV COMPOSER_ALLOW_SUPERUSER=1
ENV COMPOSER_HOME=/var/www/.config/composer
ENV COMPOSER_CACHE_DIR=/var/www/.cache/composer
# php image's www-data user uid & gid are 82, change them to 1000 (primary user)
RUN usermod -u 1000 www-data && groupmod -g 1000 www-data
# php image's www-data user uid & gid are 82, change them to 1000 (primary user) # php image's www-data user uid & gid are 82, change them to 1000 (primary user)
# RUN usermod -u 1000 www-data && groupmod -g 1000 www-data # RUN usermod -u 1000 www-data && groupmod -g 1000 www-data
# Use www-data to run the first process # Use www-data to run the first process