1- FROM php:8.3.30-cli-alpine
1+ FROM php:8.4.17-cli-alpine
2+ ARG S6_OVERLAY_VERSION=3.2.1.0
23
34LABEL Maintainer="ShaoBo Wan (Tinywan) <756684177@qq.com>" \
4- Description="Webman Lightweight container with PHP 8.4.16 based on Alpine Linux."
5+ Description="Webman Lightweight container with PHP 8.4.16 based on Alpine Linux with S6 Overlay ."
56
67# Use Alibaba Cloud mirror for faster downloads
78RUN sed -i "s/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g" /etc/apk/repositories
89
910# Install runtime dependencies only (build deps will be installed and removed later)
10- RUN apk add --no-cache curl ca-certificates tzdata supervisor
11+ RUN apk add --no-cache curl ca-certificates tzdata
1112
1213COPY ./extension /tmp/extension
1314WORKDIR /tmp/extension
@@ -24,22 +25,35 @@ RUN apk add --no-cache --virtual .build-deps \
2425 && rm -rf /var/cache/apk /tmp/* /root/.pearrc /usr/local/include/php \
2526 && mkdir -p /var/cache/apk
2627
27- # Add Composer (with cache cleanup)
28+ # Add Composer (with cache cleanup, no plugins/scripts )
2829RUN curl -sS https://getcomposer.org/installer | php \
2930 && mv composer.phar /usr/local/bin/composer \
30- && rm -rf /root/.composer/cache
31+ && composer --version \
32+ && rm -rf /root/.composer/cache /tmp/*
3133
3234# Configure PHP
3335COPY config/php.ini /usr/local/etc/php/conf.d/zzz_custom.ini
3436
35- # Configure supervisord
36- COPY config/supervisord.conf /etc/supervisor/conf.d/supervisord.conf
37-
3837# Setup document root
3938RUN mkdir -p /app
4039
40+ # Add entrypoint script for auto composer install
41+ COPY entrypoint.sh /usr/local/bin/entrypoint.sh
42+ RUN chmod +x /usr/local/bin/entrypoint.sh
43+
44+ # Install S6 Overlay v3 (download, extract, cleanup in one layer)
45+ RUN apk add --no-cache curl \
46+ && curl -fsSL https://github.com/just-containers/s6-overlay/releases/download/v${S6_OVERLAY_VERSION}/s6-overlay-noarch.tar.xz -o /tmp/s6-overlay-noarch.tar.xz \
47+ && tar -C / -Jxpf /tmp/s6-overlay-noarch.tar.xz \
48+ && curl -fsSL https://github.com/just-containers/s6-overlay/releases/download/v${S6_OVERLAY_VERSION}/s6-overlay-x86_64.tar.xz -o /tmp/s6-overlay-x86_64.tar.xz \
49+ && tar -C / -Jxpf /tmp/s6-overlay-x86_64.tar.xz \
50+ && rm -f /tmp/s6-overlay-*.tar.xz \
51+ && apk del curl
52+
53+ # Use S6 Overlay as init system with environment to override services
4154VOLUME /app
4255WORKDIR /app
4356EXPOSE 8787
4457
45- CMD ["/usr/bin/supervisord" , "-c" , "/etc/supervisor/conf.d/supervisord.conf" ]
58+ ENTRYPOINT ["/usr/local/bin/entrypoint.sh" ]
59+ CMD ["php" , "start.php" ,"start" ]
0 commit comments