diff --git a/.github/workflows/build-pr.yml b/.github/workflows/build-pr.yml index 0f054d6..a249ce8 100644 --- a/.github/workflows/build-pr.yml +++ b/.github/workflows/build-pr.yml @@ -27,3 +27,5 @@ jobs: env: PHP_VERSION: ${{ matrix.php }} STREAM: ${{ env.stream }} + with: + source: . diff --git a/.github/workflows/build-push-stable.yml b/.github/workflows/build-push-stable.yml index f6dfe18..b4bcdfa 100644 --- a/.github/workflows/build-push-stable.yml +++ b/.github/workflows/build-push-stable.yml @@ -1,4 +1,4 @@ -name: 🏗️ Build and Push Latest +name: 🏗️ Build and Push Stable on: push: diff --git a/.github/workflows/build-push.yml b/.github/workflows/build-push.yml index 4898a5b..f99a5e0 100644 --- a/.github/workflows/build-push.yml +++ b/.github/workflows/build-push.yml @@ -45,6 +45,7 @@ jobs: uses: actions/checkout@v6 with: ref: ${{ inputs.branch }} + fetch-depth: 0 - name: 🔑 Login to Docker Hub uses: docker/login-action@v3 @@ -68,4 +69,5 @@ jobs: PHP_VERSION: ${{ matrix.php }} STREAM: ${{ inputs.stream }} with: + source: . push: ${{ inputs.push }} diff --git a/base/Dockerfile b/base/Dockerfile index 03a51e6..646db4a 100644 --- a/base/Dockerfile +++ b/base/Dockerfile @@ -2,7 +2,6 @@ ARG ALPINE_VERSION=3.21 ARG PHP_VERSION=8.0 FROM docker.io/skpr/docconv:alpine${ALPINE_VERSION} AS docconv -FROM ghcr.io/skpr/compass-extension:v1.10.0-php${PHP_VERSION} AS compass FROM from_image AS base @@ -25,7 +24,7 @@ RUN mkdir /data && \ WORKDIR /data RUN apk add --no-cache curl && \ - curl -sSL "https://packages.skpr.io/php-alpine/${ALPINE_VERSION}/php${PHP_VERSION}/skpr-${TARGETARCH}.rsa.pub" -o /etc/apk/keys/skpr.rsa.pub && \ + curl -sSL https://packages.skpr.io/php-alpine/skpr.rsa.pub -o /etc/apk/keys/skpr.rsa.pub && \ echo "https://packages.skpr.io/php-alpine/${ALPINE_VERSION}/php${PHP_VERSION}" >> /etc/apk/repositories RUN apk --update --no-cache add \ @@ -75,15 +74,10 @@ RUN if [ "${PHP_VERSION}" != "8.5" ]; then \ apk add --no-cache php${PHP_VERSION}-opcache; \ fi -RUN export SKPRMAIL_VERSION=1.0.1 && \ +RUN export SKPRMAIL_VERSION=1.0.3 && \ curl -sSL https://github.com/skpr/mail/releases/download/v${SKPRMAIL_VERSION}/skprmail_${SKPRMAIL_VERSION}_linux_${TARGETARCH} -o /usr/local/bin/skprmail && \ chmod +rx /usr/local/bin/skprmail -# https://github.com/skpr/compass -ENV COMPASS_ENABLED=false -COPY --from=compass /etc/php/conf.d/00_compass.ini /etc/php/conf.d/00_compass.ini -COPY --from=compass /usr/lib/php/modules/compass.so /usr/lib/php/modules/compass.so - # Built using an updated build approach in this fork: https://github.com/skpr/docconv COPY --from=docconv /usr/local/bin/docconv /usr/local/bin/docconv diff --git a/fpm/Dockerfile b/fpm/Dockerfile index ca29f76..cea37c4 100644 --- a/fpm/Dockerfile +++ b/fpm/Dockerfile @@ -2,6 +2,7 @@ FROM from_image AS base ARG PHP_VERSION=8.0 RUN apk --update --no-cache add \ + php${PHP_VERSION}-compass \ php${PHP_VERSION}-fpm COPY conf.d/50_fpm.ini /etc/php/conf.d/50_fpm.ini @@ -33,6 +34,9 @@ COPY --from=ghcr.io/goss-org/goss:latest /usr/bin/goss /usr/bin/goss ADD goss.yml /tmp/goss.yml RUN goss --gossfile /tmp/goss.yml validate +ENV COMPASS_ENABLED=false +ENV COMPASS_FUNCTION_THRESHOLD=1000000 + # The final stage which is used to run the image. FROM base AS run CMD ["php-fpm", "-F"] diff --git a/fpm/goss.yml b/fpm/goss.yml index bc8f64e..d8d6863 100644 --- a/fpm/goss.yml +++ b/fpm/goss.yml @@ -5,3 +5,9 @@ command: stdout: not: contain-substring: "WARNING" + + check-php-compass-extension: + exec: "php -m | grep -i compass" + exit-status: 0 + stdout: + contain-substring: "compass" diff --git a/fpm/php-fpm.conf b/fpm/php-fpm.conf index 39c402a..2ed2f31 100644 --- a/fpm/php-fpm.conf +++ b/fpm/php-fpm.conf @@ -19,7 +19,7 @@ pm.status_path = /status ping.path = /readyz ping.response = 'Ready!' -access.format='{ "timestamp": "%{%Y-%m-%dT%H:%M:%S%z}T", "skpr_component": "fpm", "client_ip": "%{HTTP_X_FORWARDED_FOR}e", "remote_addr": "%R", "remote_user": "%u", "request_uri": "%{REQUEST_URI}e", "status": "%s", "body_bytes_sent": "%l", "request_time": "%d", "http_referrer": "%{HTTP_REFERER}e", "http_user_agent": "%{HTTP_USER_AGENT}e", "request_id": "%{HTTP_X_REQUEST_ID}e", "cpu": "%C", "memory": "%M", "headers": { "Cache-Control": "%{Cache-Control}o"} }' +access.format='{ "timestamp": "%{%Y-%m-%dT%H:%M:%S%z}T", "skpr_component": "fpm", "client_ip": "%{HTTP_X_FORWARDED_FOR}e", "remote_addr": "%R", "remote_user": "%u", "request_uri": "%{REQUEST_URI}e", "status": "%s", "body_bytes_sent": "%l", "request_time": "%d", "http_referrer": "%{HTTP_REFERER}e", "http_user_agent": "%{HTTP_USER_AGENT}e", "request_id": "%{HTTP_X_REQUEST_ID}e", "cpu": "%C", "memory": "%M", "headers": { "Cache-Control": "%{Cache-Control}o" }, "cloudfront": { "CloudFront-Viewer-Address": "%{HTTP_CLOUDFRONT_VIEWER_ADDRESS}e", "CloudFront-Viewer-JA4-Fingerprint": "%{HTTP_CLOUDFRONT_VIEWER_JA4_FINGERPRINT}e" } }' access.log = /proc/self/fd/2 clear_env = no