11FROM php:8.4.16-cli-alpine
22
33LABEL Maintainer="ShaoBo Wan (Tinywan) <756684177@qq.com>" \
4- Description="Webman Lightweight container with PHP 8.4.16 based on Alpine Linux."
4+ Description="Webman Lightweight container with PHP 8.4.16 based on Alpine Linux with S6 Overlay ."
55
66# Use Alibaba Cloud mirror for faster downloads
77RUN sed -i "s/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g" /etc/apk/repositories
88
9+ # Install S6 Overlay v3
10+ ADD https://github.com/just-containers/s6-overlay/releases/download/v3.2.0.0/s6-overlay-noarch.tar.xz /tmp
11+ RUN tar -C / -Jxpf /tmp/s6-overlay-noarch.tar.xz && rm /tmp/s6-overlay-noarch.tar.xz
12+ ADD https://github.com/just-containers/s6-overlay/releases/download/v3.2.0.0/s6-overlay-x86_64.tar.xz /tmp
13+ RUN tar -C / -Jxpf /tmp/s6-overlay-x86_64.tar.xz && rm /tmp/s6-overlay-x86_64.tar.xz
14+
915# Install runtime dependencies only (build deps will be installed and removed later)
10- RUN apk add --no-cache curl ca-certificates tzdata supervisor
16+ RUN apk add --no-cache curl ca-certificates tzdata
1117
1218COPY ./extension /tmp/extension
1319WORKDIR /tmp/extension
@@ -31,14 +37,20 @@ RUN curl -sS https://getcomposer.org/installer | php \
3137# Configure PHP
3238COPY config/php.ini /usr/local/etc/php/conf.d/zzz_custom.ini
3339
34- # Configure supervisord
35- COPY config/supervisord.conf /etc/supervisor/conf.d/supervisord.conf
40+ # Setup S6 Overlay services
41+ COPY config/s6/ /etc/s6-overlay/
42+
43+ # Make scripts executable
44+ RUN chmod +x /etc/s6-overlay/cont-init.d/* \
45+ && chmod +x /etc/s6-overlay/services/*/run 2>/dev/null || true
3646
3747# Setup document root
3848RUN mkdir -p /app
3949
50+ # Set S6 Overlay as entrypoint
51+ ENTRYPOINT ["/init" ]
4052VOLUME /app
4153WORKDIR /app
4254EXPOSE 8787
4355
44- CMD ["/usr/bin/supervisord" , "-c" , "/etc/supervisor/conf.d/supervisord.conf" ]
56+ CMD []
0 commit comments