fix: migrate from jcabillot/phpapache to dunglas/frankenphp
This commit is contained in:
@@ -0,0 +1,10 @@
|
||||
{
|
||||
auto_https off
|
||||
frankenphp
|
||||
}
|
||||
|
||||
:8080 {
|
||||
root * /app/public
|
||||
encode zstd br gzip
|
||||
file_server
|
||||
}
|
||||
+7
-3
@@ -1,5 +1,9 @@
|
||||
ARG VERSION="latest"
|
||||
FROM "jcabillot/phpapache:${VERSION}"
|
||||
FROM dunglas/frankenphp:1-php8.5-alpine
|
||||
LABEL maintainer="Julien Cabillot <dockerimages@cabillot.eu>"
|
||||
|
||||
COPY "root" "/var/www/html"
|
||||
WORKDIR /app
|
||||
|
||||
COPY Caddyfile /etc/frankenphp/Caddyfile
|
||||
COPY --chown=www-data:www-data root /app/public
|
||||
|
||||
USER www-data
|
||||
|
||||
+11
-4
@@ -58,10 +58,17 @@ done
|
||||
|
||||
echo ""
|
||||
echo "Test: GET / (HTML redirect)"
|
||||
RESPONSE=$(curl -sf -D - "$BASE_URL/")
|
||||
STATUS=$(echo "$RESPONSE" | head -1 | grep -oP '\d{3}')
|
||||
CONTENT_TYPE=$(echo "$RESPONSE" | grep -i 'content-type' | tr -d '\r' | cut -d: -f2- | xargs)
|
||||
BODY=$(echo "$RESPONSE" | sed -n '/^\r$/,$p' | tail -n +2)
|
||||
# Use temp file to avoid pipefail/SIGPIPE issues
|
||||
TMPDIR=$(mktemp -d)
|
||||
cleanup() {
|
||||
docker rm -f "$CONTAINER_NAME" >/dev/null 2>&1 || true
|
||||
rm -rf "$TMPDIR"
|
||||
}
|
||||
curl -sf -o "$TMPDIR/body" -D "$TMPDIR/headers" "$BASE_URL/"
|
||||
STATUS=$(head -1 "$TMPDIR/headers" | grep -oP '\d{3}')
|
||||
CONTENT_TYPE=$(grep -i 'content-type' "$TMPDIR/headers" | tr -d '\r' | cut -d: -f2- | xargs)
|
||||
BODY=$(cat "$TMPDIR/body")
|
||||
trap cleanup EXIT
|
||||
|
||||
assert "HTTP status is 200" "200" "$STATUS"
|
||||
assert_match "Content-Type is text/html" "text/html" "$CONTENT_TYPE"
|
||||
|
||||
Reference in New Issue
Block a user