78 lines
2.0 KiB
Docker
78 lines
2.0 KiB
Docker
#syntax=docker/dockerfile:1
|
|
|
|
# Versions
|
|
FROM dunglas/frankenphp:1-php8.4 AS frankenphp_upstream
|
|
|
|
# The different stages of this Dockerfile are meant to be built into separate images
|
|
# https://docs.docker.com/develop/develop-images/multistage-build/#stop-at-a-specific-build-stage
|
|
# https://docs.docker.com/compose/compose-file/#target
|
|
|
|
|
|
# Base FrankenPHP image
|
|
FROM frankenphp_upstream AS frankenphp_base
|
|
|
|
WORKDIR /app
|
|
|
|
VOLUME /app/var/
|
|
|
|
# persistent / runtime deps
|
|
# hadolint ignore=DL3008
|
|
RUN apt-get update && apt-get install -y --no-install-recommends \
|
|
acl \
|
|
file \
|
|
gettext \
|
|
git \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
RUN set -eux; \
|
|
install-php-extensions \
|
|
@composer \
|
|
apcu \
|
|
intl \
|
|
opcache \
|
|
zip \
|
|
;
|
|
|
|
# https://getcomposer.org/doc/03-cli.md#composer-allow-superuser
|
|
ENV COMPOSER_ALLOW_SUPERUSER=1
|
|
|
|
# Transport to use by Mercure (default to Bolt)
|
|
ENV MERCURE_TRANSPORT_URL=bolt:///data/mercure.db
|
|
|
|
ENV PHP_INI_SCAN_DIR=":$PHP_INI_DIR/app.conf.d"
|
|
|
|
###> recipes ###
|
|
###> doctrine/doctrine-bundle ###
|
|
#RUN install-php-extensions pdo pdo_mysql
|
|
RUN docker-php-ext-install pdo pdo_mysql
|
|
RUN docker-php-ext-enable pdo pdo_mysql
|
|
###< doctrine/doctrine-bundle ###
|
|
###< recipes ###
|
|
|
|
COPY --link frankenphp/conf.d/10-app.ini $PHP_INI_DIR/app.conf.d/
|
|
COPY --link --chmod=755 frankenphp/docker-entrypoint.sh /usr/local/bin/docker-entrypoint
|
|
COPY --link frankenphp/Caddyfile /etc/frankenphp/Caddyfile
|
|
|
|
ENTRYPOINT ["docker-entrypoint"]
|
|
|
|
HEALTHCHECK --start-period=60s CMD curl -f http://localhost:2019/metrics || exit 1
|
|
CMD [ "frankenphp", "run", "--config", "/etc/frankenphp/Caddyfile" ]
|
|
|
|
# Dev FrankenPHP image
|
|
FROM frankenphp_base AS frankenphp_dev
|
|
|
|
ENV APP_ENV=dev
|
|
ENV XDEBUG_MODE=off
|
|
#ENV FRANKENPHP_WORKER_CONFIG=watch
|
|
|
|
RUN mv "$PHP_INI_DIR/php.ini-development" "$PHP_INI_DIR/php.ini"
|
|
|
|
RUN set -eux; \
|
|
install-php-extensions \
|
|
xdebug \
|
|
;
|
|
|
|
COPY --link frankenphp/conf.d/20-app.dev.ini $PHP_INI_DIR/app.conf.d/
|
|
|
|
CMD [ "frankenphp", "run", "--config", "/etc/frankenphp/Caddyfile", "--watch" ]
|