feat: use install-php-extensions to install Composer

This commit is contained in:
Kévin Dunglas 2024-01-11 11:04:24 +01:00 committed by Maxime Helias
parent 57babffb97
commit 7ba5d5aee7

View File

@ -2,8 +2,6 @@
# Versions
FROM dunglas/frankenphp:1-alpine AS frankenphp_upstream
FROM composer/composer:2-bin AS composer_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
@ -26,12 +24,16 @@ RUN apk add --no-cache \
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
###> recipes ###
###< recipes ###
@ -41,12 +43,6 @@ COPY --link frankenphp/Caddyfile /etc/caddy/Caddyfile
ENTRYPOINT ["docker-entrypoint"]
# https://getcomposer.org/doc/03-cli.md#composer-allow-superuser
ENV COMPOSER_ALLOW_SUPERUSER=1
ENV PATH="${PATH}:/root/.composer/vendor/bin"
COPY --from=composer_upstream --link /composer /usr/bin/composer
HEALTHCHECK --start-period=60s CMD curl -f http://localhost:2019/metrics || exit 1
CMD [ "frankenphp", "run", "--config", "/etc/caddy/Caddyfile" ]