Skip to content

Commit

Permalink
move php sockets/fix healthcheck/update caddy
Browse files Browse the repository at this point in the history
Update caddy Docker tag to v2.7.2

Signed-off-by: Zoey <zoey@z0ey.de>
  • Loading branch information
renovate[bot] authored and Zoey2936 committed Aug 7, 2023
1 parent 991b2c1 commit 4b61970
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 10 deletions.
2 changes: 1 addition & 1 deletion Caddy.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
FROM caddy:2.6.4
FROM caddy:2.7.2
RUN apk add --no-cache ca-certificates tzdata
COPY Caddyfile /etc/caddy/Caddyfile
11 changes: 6 additions & 5 deletions rootfs/bin/healthcheck.sh
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
#!/bin/sh

export HC_IP="localhost"
export NPM_PORT="${NPM_PORT:-81}"

if [ "$NPM_LISTEN_LOCALHOST" = "true" ]; then
export NPM_IPV4_BINDING="127.0.0.1"
export NPM_IPV6_BINDING="[::1]"
fi

if [ -n "$NPM_IPV6_BINDING" ]; then
export HC_IP="$NPM_IPV6_BINDING"
elif [ -n "$NPM_IPV4_BINDING" ]; then
export HC_IP="$NPM_IPV4_BINDING"
if [ "$NPM_IPV6_BINDING" != "[::]" ] && [ "$NPM_IPV4_BINDING" != "0.0.0.0" ]; then
if [ "$NPM_IPV6_BINDING" != "[::]" ]; then
export HC_IP="$NPM_IPV6_BINDING"
elif [ "$NPM_IPV4_BINDING" != "0.0.0.0" ]; then
export HC_IP="$NPM_IPV4_BINDING"
fi
fi

if (if [ "$PHP81" = true ]; then cgi-fcgi -bind -connect /dev/php81.sock > /dev/null 2>&1; fi && if [ "$PHP82" = true ]; then cgi-fcgi -bind -connect /dev/php82.sock > /dev/null 2>&1; fi && [ "$(curl -sk https://"$HC_IP":"$NPM_PORT"/api/ | jq --raw-output .status)" = "OK" ]); then
Expand Down
4 changes: 2 additions & 2 deletions rootfs/bin/start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ apk add --no-cache php81-fpm

mkdir -vp /data/php
cp -vrnT /etc/php81 /data/php/81
sed -i "s|listen =.*|listen = /var/php81.sock|" /data/php/81/php-fpm.d/www.conf
sed -i "s|listen =.*|listen = /var/run/php81.sock|" /data/php/81/php-fpm.d/www.conf
sed -i "s|include=.*|include=/data/php/81/php-fpm.d/*.conf|g" /data/php/81/php-fpm.conf

elif [ "$FULLCLEAN" = "true" ]; then
Expand Down Expand Up @@ -192,7 +192,7 @@ apk add --no-cache php82-fpm

mkdir -vp /data/php
cp -vrnT /etc/php82 /data/php/82
sed -i "s|listen =.*|listen = /var/php82.sock|" /data/php/82/php-fpm.d/www.conf
sed -i "s|listen =.*|listen = /var/run/php82.sock|" /data/php/82/php-fpm.d/www.conf
sed -i "s|include=.*|include=/data/php/82/php-fpm.d/*.conf|g" /data/php/82/php-fpm.conf

elif [ "$FULLCLEAN" = "true" ]; then
Expand Down
4 changes: 2 additions & 2 deletions rootfs/usr/local/nginx/conf/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,11 @@ http {
}

upstream php81 {
server unix:/var/php81.sock;
server unix:/var/run/php81.sock;
}

upstream php82 {
server unix:/var/php82.sock;
server unix:/var/run/php82.sock;
}

# Fancy Index
Expand Down

0 comments on commit 4b61970

Please sign in to comment.