Skip to content

Commit

Permalink
Merge pull request #274 from kdnetwork/fix-docker
Browse files Browse the repository at this point in the history
- 修复 Dockerfile 配置导致的 docker build 失败
BANKA2017 authored Dec 21, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
2 parents 6335691 + 7c5a4c6 commit ec864f0
Showing 2 changed files with 42 additions and 42 deletions.
78 changes: 39 additions & 39 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,39 +1,39 @@
FROM alpine

ENV LANG=zh_CN.UTF-8 \
TZ=Asia/Shanghai \
WORKDIR=/var/www \
PS1="\u@\h:\w \$ "

RUN apk add --no-cache \
bash \
busybox-suid \
caddy \
git \
php81 \
php81-curl \
php81-fpm \
php81-gd \
php81-json \
php81-mbstring \
php81-mysqli \
php81-session \
php81-zip \
s6-overlay \
shadow \
tzdata \
&& caddy upgrade \
&& ln -sf /usr/share/zoneinfo/${TZ} /etc/localtime \
&& echo -e "${TZ}" > /etc/timezone \
&& echo -e "max_execution_time = 3600\nupload_max_filesize=128M\npost_max_size=128M\nmemory_limit=1024M\ndate.timezone=${TZ}" > /etc/php81/conf.d/99-overrides.ini \
&& echo -e "[global]\nerror_log = /dev/stdout\ndaemonize = no\ninclude=/etc/php81/php-fpm.d/*.conf" > /etc/php81/php-fpm.conf \
&& echo -e "[www]\nuser = caddy\ngroup = caddy\nlisten = 127.0.0.1:9000\nlisten.owner = caddy\nlisten.group = caddy\npm = ondemand\npm.max_children = 75\npm.max_requests = 500\npm.process_idle_timeout = 10s\nchdir = $WORKDIR" > /etc/php81/php-fpm.d/www.conf \
&& echo -e "{\n admin off\n}\n:8080\nroot * $WORKDIR\nlog {\n level warn\n}\nphp_fastcgi 127.0.0.1:9000\nfile_server" > /etc/caddy/Caddyfile \
&& rm -rf $WORKDIR/* /var/cache/apk/* /tmp/* \
&& git config --global pull.ff only \
&& git clone --depth=1 -b master https://github.com/MoeNetwork/Tieba-Cloud-Sign $WORKDIR \
&& mkdir /etc/cont-init.d \
&& mkdir /etc/services.d \
&& cp -r /var/www/docker/s6-overlay/etc/* /etc/

ENTRYPOINT ["/init"]
FROM alpine:3.21.0

ENV LANG=zh_CN.UTF-8 \
TZ=Asia/Shanghai \
WORKDIR=/var/www \
PS1="\u@\h:\w \$ "

RUN apk add --no-cache \
bash \
busybox-suid \
caddy \
git \
php84 \
php84-curl \
php84-fpm \
php84-gd \
php84-json \
php84-mbstring \
php84-mysqli \
php84-session \
php84-zip \
s6-overlay \
shadow \
tzdata \
&& caddy upgrade \
&& ln -sf /usr/share/zoneinfo/${TZ} /etc/localtime \
&& echo -e "${TZ}" > /etc/timezone \
&& echo -e "max_execution_time = 3600\nupload_max_filesize=128M\npost_max_size=128M\nmemory_limit=1024M\ndate.timezone=${TZ}" > /etc/php84/conf.d/99-overrides.ini \
&& echo -e "[global]\nerror_log = /dev/stdout\ndaemonize = no\ninclude=/etc/php84/php-fpm.d/*.conf" > /etc/php84/php-fpm.conf \
&& echo -e "[www]\nuser = caddy\ngroup = caddy\nlisten = 127.0.0.1:9000\nlisten.owner = caddy\nlisten.group = caddy\npm = ondemand\npm.max_children = 75\npm.max_requests = 500\npm.process_idle_timeout = 10s\nchdir = $WORKDIR" > /etc/php84/php-fpm.d/www.conf \
&& echo -e "{\n admin off\n}\n:8080\nroot * $WORKDIR\nlog {\n level warn\n}\nphp_fastcgi 127.0.0.1:9000\nfile_server" > /etc/caddy/Caddyfile \
&& rm -rf $WORKDIR/* /var/cache/apk/* /tmp/* \
&& git config --global pull.ff only \
&& git clone --depth=1 -b master https://github.com/MoeNetwork/Tieba-Cloud-Sign $WORKDIR \
&& mkdir /etc/cont-init.d \
&& mkdir /etc/services.d \
&& cp -r /var/www/docker/s6-overlay/etc/* /etc/

ENTRYPOINT ["/init"]
6 changes: 3 additions & 3 deletions docker/s6-overlay/etc/services.d/php-fpm/run
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/usr/bin/with-contenv bash

exec php-fpm81
#!/usr/bin/with-contenv bash
exec php-fpm84

0 comments on commit ec864f0

Please sign in to comment.