Skip to content
Merged
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
30 changes: 30 additions & 0 deletions .github/workflows/frankenphp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,21 @@
cache-from: type=gha, scope=${{ github.workflow }}-frankenphp
cache-to: type=gha, scope=${{ github.workflow }}-frankenphp, mode=max

- name: Build and push (frankenphp-cron)
uses: docker/build-push-action@v7
timeout-minutes: 120
with:
builder: ${{ steps.buildx.outputs.name }}
context: ./php
target: frankenphp-cron
file: ./php/${{ matrix.image.file || 'Dockerfile' }}
build-args: ${{ matrix.image.build-args }}
push: ${{ github.event_name != 'pull_request' }}
tags: ghcr.io/netlogix/docker/frankenphp-cron:${{ matrix.image.version }}
platforms: linux/amd64,linux/arm64
cache-from: type=gha, scope=${{ github.workflow }}-frankenphp
cache-to: type=gha, scope=${{ github.workflow }}-frankenphp, mode=max

build-docker-dev-image:
name: 'Build frankenphp-${{ matrix.image.version }}-dev docker image'
runs-on: ubuntu-latest
Expand All @@ -121,7 +136,7 @@
- name: Checkout
uses: actions/checkout@v7

- name: Setup QEMU

Check warning

Code scanning / CodeQL

Unpinned tag for a non-immutable Action or reusable workflow Medium

Unpinned 3rd party Action 'Build franken docker image' step
Uses Step
uses 'docker/build-push-action' with ref 'v7', not a pinned commit hash
uses: docker/setup-qemu-action@v4

- name: Setup Docker Buildx
Expand Down Expand Up @@ -164,3 +179,18 @@
platforms: linux/amd64,linux/arm64
cache-from: type=gha, scope=${{ github.workflow }}-frankenphp-dev
cache-to: type=gha, scope=${{ github.workflow }}-frankenphp-dev, mode=max

- name: Build and push (frankenphp-cron-dev)
uses: docker/build-push-action@v7
timeout-minutes: 120
with:
builder: ${{ steps.buildx.outputs.name }}
context: ./php
target: frankenphp-cron-dev
file: ./php/${{ matrix.image.file || 'Dockerfile' }}
build-args: ${{ matrix.image.build-args }}
push: ${{ github.event_name != 'pull_request' }}
tags: ghcr.io/netlogix/docker/frankenphp-cron-dev:${{ matrix.image.version }}
platforms: linux/amd64,linux/arm64
cache-from: type=gha, scope=${{ github.workflow }}-frankenphp-dev
cache-to: type=gha, scope=${{ github.workflow }}-frankenphp-dev, mode=max)
41 changes: 16 additions & 25 deletions build-container.sh
Original file line number Diff line number Diff line change
Expand Up @@ -41,33 +41,12 @@ docker buildx build -t ghcr.io/netlogix/docker/prometheus-redis-exporter:${VERSI
docker buildx build -t ghcr.io/netlogix/docker/prometheus-solr-exporter:${VERSION} -f prometheus-solr-exporter/Dockerfile prometheus-solr-exporter
docker buildx build -t ghcr.io/netlogix/docker/prometheus-varnish-exporter:${VERSION} -f prometheus-varnish-exporter/Dockerfile prometheus-varnish-exporter

docker buildx build -t ghcr.io/netlogix/docker/php-fpm:7.2 --build-arg PHP_VERSION=7.2 --build-arg UBUNTU_VERSION=24.04 -f php/7.x.Dockerfile --target=php-fpm php
docker buildx build -t ghcr.io/netlogix/docker/php-cli:7.2 --build-arg PHP_VERSION=7.2 --build-arg UBUNTU_VERSION=24.04 -f php/7.x.Dockerfile --target=php-cli php
docker buildx build -t ghcr.io/netlogix/docker/php-fpm-dev:7.2 --build-arg PHP_VERSION=7.2 --build-arg UBUNTU_VERSION=24.04 -f php/7.x.Dockerfile --target=php-fpm-dev php
docker buildx build -t ghcr.io/netlogix/docker/php-cli-dev:7.2 --build-arg PHP_VERSION=7.2 --build-arg UBUNTU_VERSION=24.04 -f php/7.x.Dockerfile --target=php-cli-dev php
docker buildx build -t ghcr.io/netlogix/docker/php-cron:7.2 --build-arg PHP_VERSION=7.2 --build-arg UBUNTU_VERSION=24.04 -f php/7.x.Dockerfile --target=php-cron php
docker buildx build -t ghcr.io/netlogix/docker/php-cron-dev:7.2 --build-arg PHP_VERSION=7.2 --build-arg UBUNTU_VERSION=24.04 -f php/7.x.Dockerfile --target=php-cron-dev php
docker buildx build -t ghcr.io/netlogix/docker/php-supervisor:7.2 --build-arg PHP_VERSION=7.2 --build-arg UBUNTU_VERSION=24.04 -f php/7.x.Dockerfile --target=php-supervisor php

docker buildx build -t ghcr.io/netlogix/docker/php-fpm:7.3 --build-arg PHP_VERSION=7.3 --build-arg UBUNTU_VERSION=24.04 -f php/7.x.Dockerfile --target=php-fpm php
docker buildx build -t ghcr.io/netlogix/docker/php-cli:7.3 --build-arg PHP_VERSION=7.3 --build-arg UBUNTU_VERSION=24.04 -f php/7.x.Dockerfile --target=php-cli php
docker buildx build -t ghcr.io/netlogix/docker/php-fpm-dev:7.3 --build-arg PHP_VERSION=7.3 --build-arg UBUNTU_VERSION=24.04 -f php/7.x.Dockerfile --target=php-fpm-dev php
docker buildx build -t ghcr.io/netlogix/docker/php-cli-dev:7.3 --build-arg PHP_VERSION=7.3 --build-arg UBUNTU_VERSION=24.04 -f php/7.x.Dockerfile --target=php-cli-dev php
docker buildx build -t ghcr.io/netlogix/docker/php-cron:7.3 --build-arg PHP_VERSION=7.3 --build-arg UBUNTU_VERSION=24.04 -f php/7.x.Dockerfile --target=php-cron php
docker buildx build -t ghcr.io/netlogix/docker/php-cron-dev:7.3 --build-arg PHP_VERSION=7.3 --build-arg UBUNTU_VERSION=24.04 -f php/7.x.Dockerfile --target=php-cron-dev php
docker buildx build -t ghcr.io/netlogix/docker/php-supervisor:7.3 --build-arg PHP_VERSION=7.3 --build-arg UBUNTU_VERSION=24.04 -f php/7.x.Dockerfile --target=php-supervisor php

docker buildx build -t ghcr.io/netlogix/docker/php-fpm:7.4 --build-arg PHP_VERSION=7.4 --build-arg UBUNTU_VERSION=20.04 -f php/7.x.Dockerfile --target=php-fpm php
docker buildx build -t ghcr.io/netlogix/docker/php-cli:7.4 --build-arg PHP_VERSION=7.4 --build-arg UBUNTU_VERSION=20.04 -f php/7.x.Dockerfile --target=php-cli php
docker buildx build -t ghcr.io/netlogix/docker/php-fpm-dev:7.4 --build-arg PHP_VERSION=7.4 --build-arg UBUNTU_VERSION=20.04 -f php/7.x.Dockerfile --target=php-fpm-dev php
docker buildx build -t ghcr.io/netlogix/docker/php-cli-dev:7.4 --build-arg PHP_VERSION=7.4 --build-arg UBUNTU_VERSION=20.04 -f php/7.x.Dockerfile --target=php-cli-dev php
docker buildx build -t ghcr.io/netlogix/docker/php-cron:7.4 --build-arg PHP_VERSION=7.4 --build-arg UBUNTU_VERSION=20.04 -f php/7.x.Dockerfile --target=php-cron php
docker buildx build -t ghcr.io/netlogix/docker/php-cron-dev:7.4 --build-arg PHP_VERSION=7.4 --build-arg UBUNTU_VERSION=20.04 -f php/7.x.Dockerfile --target=php-cron-dev php
docker buildx build -t ghcr.io/netlogix/docker/php-supervisor:7.4 --build-arg PHP_VERSION=7.4 --build-arg UBUNTU_VERSION=20.04 -f php/7.x.Dockerfile --target=php-supervisor php

docker buildx build -t ghcr.io/netlogix/docker/php-fpm:8.0 --build-arg PHP_VERSION=8.0 --build-arg UBUNTU_VERSION=24.04 -f php/8.x.Dockerfile --target=php-fpm php
docker buildx build -t ghcr.io/netlogix/docker/php-cli:8.0 --build-arg PHP_VERSION=8.0 --build-arg UBUNTU_VERSION=24.04 -f php/8.x.Dockerfile --target=php-cli php
docker buildx build -t ghcr.io/netlogix/docker/php-cron:8.0--build-arg PHP_VERSION=8.0 --build-arg UBUNTU_VERSION=24.04 -f php/8.x.Dockerfile --target=php-cron php
docker buildx build -t ghcr.io/netlogix/docker/php-fpm-dev:8.0 --build-arg PHP_VERSION=8.0 --build-arg UBUNTU_VERSION=24.04 -f php/8.x.Dockerfile --target=php-fpm-dev php
docker buildx build -t ghcr.io/netlogix/docker/php-cli-dev:8.0 --build-arg PHP_VERSION=8.0 --build-arg UBUNTU_VERSION=24.04 -f php/8.x.Dockerfile --target=php-cli-dev php
docker buildx build -t ghcr.io/netlogix/docker/php-cron:8.0 --build-arg PHP_VERSION=8.0 --build-arg UBUNTU_VERSION=24.04 -f php/8.x.Dockerfile --target=php-cron php
docker buildx build -t ghcr.io/netlogix/docker/php-cron-dev:8.0 --build-arg PHP_VERSION=8.0 --build-arg UBUNTU_VERSION=24.04 -f php/8.x.Dockerfile --target=php-cron-dev php
docker buildx build -t ghcr.io/netlogix/docker/php-supervisor:8.0 --build-arg PHP_VERSION=8.0 --build-arg UBUNTU_VERSION=24.04 -f php/8.x.Dockerfile --target=php-supervisor php

docker buildx build -t ghcr.io/netlogix/docker/php-fpm:8.1 --build-arg PHP_VERSION=8.1 --build-arg UBUNTU_VERSION=22.04 -f php/Dockerfile --target=php-fpm php
Expand Down Expand Up @@ -114,12 +93,24 @@ docker buildx build -t ghcr.io/netlogix/docker/frankenphp:8.3 --build-arg PHP_VE
docker buildx build -t ghcr.io/netlogix/docker/frankenphp-dev:8.3 --build-arg PHP_VERSION=8.3 -f php/frankenphp.Dockerfile --target=frankenphp-dev php
docker buildx build -t ghcr.io/netlogix/docker/frankenphp-cli:8.3 --build-arg PHP_VERSION=8.3 -f php/frankenphp.Dockerfile --target=frankenphp-cli php
docker buildx build -t ghcr.io/netlogix/docker/frankenphp-cli-dev:8.3 --build-arg PHP_VERSION=8.3 -f php/frankenphp.Dockerfile --target=frankenphp-cli-dev php
docker buildx build -t ghcr.io/netlogix/docker/frankenphp-cron:8.3 --build-arg PHP_VERSION=8.3 -f php/frankenphp.Dockerfile --target=frankenphp-cron php
docker buildx build -t ghcr.io/netlogix/docker/frankenphp-cron-dev:8.3 --build-arg PHP_VERSION=8.3 -f php/frankenphp.Dockerfile --target=frankenphp-cron-dev php

docker buildx build -t ghcr.io/netlogix/docker/frankenphp:8.4 --build-arg PHP_VERSION=8.4 -f php/frankenphp.Dockerfile --target=frankenphp php
docker buildx build -t ghcr.io/netlogix/docker/frankenphp-dev:8.4 --build-arg PHP_VERSION=8.4 -f php/frankenphp.Dockerfile --target=frankenphp-dev php
docker buildx build -t ghcr.io/netlogix/docker/frankenphp-cli:8.4 --build-arg PHP_VERSION=8.4 -f php/frankenphp.Dockerfile --target=frankenphp-cli php
docker buildx build -t ghcr.io/netlogix/docker/frankenphp-cli-dev:8.4 --build-arg PHP_VERSION=8.4 -f php/frankenphp.Dockerfile --target=frankenphp-cli-dev php
docker buildx build -t ghcr.io/netlogix/docker/frankenphp-cron:8.4 --build-arg PHP_VERSION=8.4 -f php/frankenphp.Dockerfile --target=frankenphp-cron php
docker buildx build -t ghcr.io/netlogix/docker/frankenphp-cron-dev:8.4 --build-arg PHP_VERSION=8.4 -f php/frankenphp.Dockerfile --target=frankenphp-cron-dev php

docker buildx build -t ghcr.io/netlogix/docker/frankenphp:8.5 --build-arg PHP_VERSION=8.5 -f php/frankenphp.Dockerfile --target=frankenphp php
docker buildx build -t ghcr.io/netlogix/docker/frankenphp-dev:8.5 --build-arg PHP_VERSION=8.5 -f php/frankenphp.Dockerfile --target=frankenphp-dev php
docker buildx build -t ghcr.io/netlogix/docker/frankenphp-cli:8.5 --build-arg PHP_VERSION=8.5 -f php/frankenphp.Dockerfile --target=frankenphp-cli php
docker buildx build -t ghcr.io/netlogix/docker/frankenphp-cli-dev:8.5 --build-arg PHP_VERSION=8.5 -f php/frankenphp.Dockerfile --target=frankenphp-cli-dev php
docker buildx build -t ghcr.io/netlogix/docker/frankenphp-cron:8.5 --build-arg PHP_VERSION=8.5 -f php/frankenphp.Dockerfile --target=frankenphp-cron php
docker buildx build -t ghcr.io/netlogix/docker/frankenphp-cron-dev:8.5 --build-arg PHP_VERSION=8.5 -f php/frankenphp.Dockerfile --target=frankenphp-cron-dev php

docker buildx build -t ghcr.io/netlogix/docker/node:18 --build-arg NODE_VERSION=18 -f node/Dockerfile node
docker buildx build -t ghcr.io/netlogix/docker/node:20 --build-arg NODE_VERSION=20 -f node/Dockerfile node
docker buildx build -t ghcr.io/netlogix/docker/node:22 --build-arg NODE_VERSION=22 -f node/Dockerfile node
docker buildx build -t ghcr.io/netlogix/docker/node:24 --build-arg NODE_VERSION=24 -f node/Dockerfile node
48 changes: 41 additions & 7 deletions php/frankenphp.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
ARG PHP_VERSION=8.4

FROM dunglas/frankenphp:php${PHP_VERSION} AS app-frankenphp-base
FROM dunglas/frankenphp:php${PHP_VERSION} AS frankenphp-base
RUN <<EOF
set -e
apt-get update -y
Expand Down Expand Up @@ -39,6 +39,7 @@
opcache \
pcntl \
pdo_mysql \
pdo_pgsql \
pgsql \
raphf \
readline \
Expand Down Expand Up @@ -74,7 +75,7 @@
rm -rf /var/cache/apt/archives /var/lib/apt/lists/*
EOF

ENV PHP_VERSION=${PHP_VERSION} \

Check warning on line 78 in php/frankenphp.Dockerfile

View workflow job for this annotation

GitHub Actions / Build frankenphp-8.3-dev docker image

Sensitive data should not be used in the ARG or ENV commands

SecretsUsedInArgOrEnv: Do not use ARG or ENV instructions for sensitive data (ENV "TIDEWAYS_APIKEY") More info: https://docs.docker.com/go/dockerfile/rule/secrets-used-in-arg-or-env/

Check warning on line 78 in php/frankenphp.Dockerfile

View workflow job for this annotation

GitHub Actions / Build frankenphp-8.3-dev docker image

Sensitive data should not be used in the ARG or ENV commands

SecretsUsedInArgOrEnv: Do not use ARG or ENV instructions for sensitive data (ENV "TIDEWAYS_APIKEY") More info: https://docs.docker.com/go/dockerfile/rule/secrets-used-in-arg-or-env/

Check warning on line 78 in php/frankenphp.Dockerfile

View workflow job for this annotation

GitHub Actions / Build frankenphp-8.3-dev docker image

Sensitive data should not be used in the ARG or ENV commands

SecretsUsedInArgOrEnv: Do not use ARG or ENV instructions for sensitive data (ENV "TIDEWAYS_APIKEY") More info: https://docs.docker.com/go/dockerfile/rule/secrets-used-in-arg-or-env/

Check warning on line 78 in php/frankenphp.Dockerfile

View workflow job for this annotation

GitHub Actions / Build frankenphp-8.3 docker image

Sensitive data should not be used in the ARG or ENV commands

SecretsUsedInArgOrEnv: Do not use ARG or ENV instructions for sensitive data (ENV "TIDEWAYS_APIKEY") More info: https://docs.docker.com/go/dockerfile/rule/secrets-used-in-arg-or-env/

Check warning on line 78 in php/frankenphp.Dockerfile

View workflow job for this annotation

GitHub Actions / Build frankenphp-8.3 docker image

Sensitive data should not be used in the ARG or ENV commands

SecretsUsedInArgOrEnv: Do not use ARG or ENV instructions for sensitive data (ENV "TIDEWAYS_APIKEY") More info: https://docs.docker.com/go/dockerfile/rule/secrets-used-in-arg-or-env/

Check warning on line 78 in php/frankenphp.Dockerfile

View workflow job for this annotation

GitHub Actions / Build frankenphp-8.3 docker image

Sensitive data should not be used in the ARG or ENV commands

SecretsUsedInArgOrEnv: Do not use ARG or ENV instructions for sensitive data (ENV "TIDEWAYS_APIKEY") More info: https://docs.docker.com/go/dockerfile/rule/secrets-used-in-arg-or-env/

Check warning on line 78 in php/frankenphp.Dockerfile

View workflow job for this annotation

GitHub Actions / Build frankenphp-8.4 docker image

Sensitive data should not be used in the ARG or ENV commands

SecretsUsedInArgOrEnv: Do not use ARG or ENV instructions for sensitive data (ENV "TIDEWAYS_APIKEY") More info: https://docs.docker.com/go/dockerfile/rule/secrets-used-in-arg-or-env/

Check warning on line 78 in php/frankenphp.Dockerfile

View workflow job for this annotation

GitHub Actions / Build frankenphp-8.4 docker image

Sensitive data should not be used in the ARG or ENV commands

SecretsUsedInArgOrEnv: Do not use ARG or ENV instructions for sensitive data (ENV "TIDEWAYS_APIKEY") More info: https://docs.docker.com/go/dockerfile/rule/secrets-used-in-arg-or-env/

Check warning on line 78 in php/frankenphp.Dockerfile

View workflow job for this annotation

GitHub Actions / Build frankenphp-8.4 docker image

Sensitive data should not be used in the ARG or ENV commands

SecretsUsedInArgOrEnv: Do not use ARG or ENV instructions for sensitive data (ENV "TIDEWAYS_APIKEY") More info: https://docs.docker.com/go/dockerfile/rule/secrets-used-in-arg-or-env/

Check warning on line 78 in php/frankenphp.Dockerfile

View workflow job for this annotation

GitHub Actions / Build frankenphp-8.5 docker image

Sensitive data should not be used in the ARG or ENV commands

SecretsUsedInArgOrEnv: Do not use ARG or ENV instructions for sensitive data (ENV "TIDEWAYS_APIKEY") More info: https://docs.docker.com/go/dockerfile/rule/secrets-used-in-arg-or-env/

Check warning on line 78 in php/frankenphp.Dockerfile

View workflow job for this annotation

GitHub Actions / Build frankenphp-8.5 docker image

Sensitive data should not be used in the ARG or ENV commands

SecretsUsedInArgOrEnv: Do not use ARG or ENV instructions for sensitive data (ENV "TIDEWAYS_APIKEY") More info: https://docs.docker.com/go/dockerfile/rule/secrets-used-in-arg-or-env/

Check warning on line 78 in php/frankenphp.Dockerfile

View workflow job for this annotation

GitHub Actions / Build frankenphp-8.5 docker image

Sensitive data should not be used in the ARG or ENV commands

SecretsUsedInArgOrEnv: Do not use ARG or ENV instructions for sensitive data (ENV "TIDEWAYS_APIKEY") More info: https://docs.docker.com/go/dockerfile/rule/secrets-used-in-arg-or-env/

Check warning on line 78 in php/frankenphp.Dockerfile

View workflow job for this annotation

GitHub Actions / Build frankenphp-8.5-dev docker image

Sensitive data should not be used in the ARG or ENV commands

SecretsUsedInArgOrEnv: Do not use ARG or ENV instructions for sensitive data (ENV "TIDEWAYS_APIKEY") More info: https://docs.docker.com/go/dockerfile/rule/secrets-used-in-arg-or-env/

Check warning on line 78 in php/frankenphp.Dockerfile

View workflow job for this annotation

GitHub Actions / Build frankenphp-8.5-dev docker image

Sensitive data should not be used in the ARG or ENV commands

SecretsUsedInArgOrEnv: Do not use ARG or ENV instructions for sensitive data (ENV "TIDEWAYS_APIKEY") More info: https://docs.docker.com/go/dockerfile/rule/secrets-used-in-arg-or-env/

Check warning on line 78 in php/frankenphp.Dockerfile

View workflow job for this annotation

GitHub Actions / Build frankenphp-8.5-dev docker image

Sensitive data should not be used in the ARG or ENV commands

SecretsUsedInArgOrEnv: Do not use ARG or ENV instructions for sensitive data (ENV "TIDEWAYS_APIKEY") More info: https://docs.docker.com/go/dockerfile/rule/secrets-used-in-arg-or-env/

Check warning on line 78 in php/frankenphp.Dockerfile

View workflow job for this annotation

GitHub Actions / Build frankenphp-8.4-dev docker image

Sensitive data should not be used in the ARG or ENV commands

SecretsUsedInArgOrEnv: Do not use ARG or ENV instructions for sensitive data (ENV "TIDEWAYS_APIKEY") More info: https://docs.docker.com/go/dockerfile/rule/secrets-used-in-arg-or-env/

Check warning on line 78 in php/frankenphp.Dockerfile

View workflow job for this annotation

GitHub Actions / Build frankenphp-8.4-dev docker image

Sensitive data should not be used in the ARG or ENV commands

SecretsUsedInArgOrEnv: Do not use ARG or ENV instructions for sensitive data (ENV "TIDEWAYS_APIKEY") More info: https://docs.docker.com/go/dockerfile/rule/secrets-used-in-arg-or-env/

Check warning on line 78 in php/frankenphp.Dockerfile

View workflow job for this annotation

GitHub Actions / Build frankenphp-8.4-dev docker image

Sensitive data should not be used in the ARG or ENV commands

SecretsUsedInArgOrEnv: Do not use ARG or ENV instructions for sensitive data (ENV "TIDEWAYS_APIKEY") More info: https://docs.docker.com/go/dockerfile/rule/secrets-used-in-arg-or-env/
PHP_DISPLAY_ERRORS=0 \
PHP_DISPLAY_STARTUP_ERRORS=0 \
PHP_MEMORY_LIMIT=512m \
Expand Down Expand Up @@ -119,20 +120,34 @@

RUN frankenphp adapt --config /etc/frankenphp/Caddyfile --pretty --validate

HEALTHCHECK --interval=2s --timeout=2s --start-period=2s --retries=3 \
CMD curl --fail --silent http://localhost:8080/health-check || exit 1
HEALTHCHECK NONE

FROM frankenphp-base AS frankenphp

LABEL prometheus_port="2020"

FROM app-frankenphp-base AS frankenphp
COPY --chown=www-data:www-data . /var/www/
HEALTHCHECK --interval=2s --timeout=2s --start-period=2s --retries=3 \
CMD curl --fail --silent http://localhost:8080/health-check || exit 1

EXPOSE 2020

FROM frankenphp AS frankenphp-cli
FROM frankenphp-base AS frankenphp-cli
ENTRYPOINT [ "frankenphp", "php-cli" ]
CMD []

FROM frankenphp-base AS frankenphp-cron

FROM app-frankenphp-base AS frankenphp-base-dev
USER root

ENV CRONTAB_PATH=/var/www/config/crontab
# cron runs jobs with a minimal PATH (/usr/bin:/bin) that excludes /usr/local/bin, so
# crontab entries calling plain `php` would fail without this symlink
RUN ln -s /usr/local/bin/php /usr/bin/php

ENTRYPOINT ["/bin/sh", "-c", "env > /etc/environment && crontab -u www-data - < \"$CRONTAB_PATH\" && exec cron -f"]
CMD []

FROM frankenphp-base AS frankenphp-base-dev

USER root

Expand Down Expand Up @@ -177,6 +192,25 @@

FROM frankenphp-base-dev AS frankenphp-dev

LABEL prometheus_port="2020"

HEALTHCHECK --interval=2s --timeout=2s --start-period=2s --retries=3 \
CMD curl --fail --silent http://localhost:8080/health-check || exit 1

EXPOSE 2020

FROM frankenphp-base-dev AS frankenphp-cli-dev
ENTRYPOINT [ "frankenphp", "php-cli" ]
CMD []

FROM frankenphp-base-dev AS frankenphp-cron-dev

USER root

ENV CRONTAB_PATH=/var/www/config/crontab
# cron runs jobs with a minimal PATH (/usr/bin:/bin) that excludes /usr/local/bin, so
# crontab entries calling plain `php` would fail without this symlink
RUN ln -s /usr/local/bin/php /usr/bin/php

ENTRYPOINT ["/bin/sh", "-c", "env > /etc/environment && crontab -u www-data - < \"$CRONTAB_PATH\" && exec cron -f"]
CMD []