Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/workflows/build-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,5 @@ jobs:
env:
PHP_VERSION: ${{ matrix.php }}
STREAM: ${{ env.stream }}
with:
source: .
2 changes: 1 addition & 1 deletion .github/workflows/build-push-stable.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: 🏗️ Build and Push Latest
name: 🏗️ Build and Push Stable

on:
push:
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/build-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -68,4 +69,5 @@ jobs:
PHP_VERSION: ${{ matrix.php }}
STREAM: ${{ inputs.stream }}
with:
source: .
push: ${{ inputs.push }}
10 changes: 2 additions & 8 deletions base/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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 \
Expand Down Expand Up @@ -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

Expand Down
4 changes: 4 additions & 0 deletions fpm/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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"]
6 changes: 6 additions & 0 deletions fpm/goss.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
2 changes: 1 addition & 1 deletion fpm/php-fpm.conf
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading