refactor: simplify Dockerfile
This commit is contained in:
parent
61eee0441a
commit
d05206ba37
10
Dockerfile
10
Dockerfile
@ -4,12 +4,6 @@
|
|||||||
# https://docs.docker.com/develop/develop-images/multistage-build/#stop-at-a-specific-build-stage
|
# https://docs.docker.com/develop/develop-images/multistage-build/#stop-at-a-specific-build-stage
|
||||||
# https://docs.docker.com/compose/compose-file/#target
|
# https://docs.docker.com/compose/compose-file/#target
|
||||||
|
|
||||||
# Builder images
|
|
||||||
FROM composer/composer:2-bin AS composer
|
|
||||||
|
|
||||||
# hadolint ignore=DL3007
|
|
||||||
FROM mlocati/php-extension-installer:latest AS php_extension_installer
|
|
||||||
|
|
||||||
# Build Caddy with the Mercure and Vulcain modules
|
# Build Caddy with the Mercure and Vulcain modules
|
||||||
# Temporary fix for https://github.com/dunglas/mercure/issues/770
|
# Temporary fix for https://github.com/dunglas/mercure/issues/770
|
||||||
FROM caddy:2.7-builder-alpine AS app_caddy_builder
|
FROM caddy:2.7-builder-alpine AS app_caddy_builder
|
||||||
@ -34,7 +28,7 @@ ENV APP_ENV=prod
|
|||||||
WORKDIR /srv/app
|
WORKDIR /srv/app
|
||||||
|
|
||||||
# php extensions installer: https://github.com/mlocati/docker-php-extension-installer
|
# php extensions installer: https://github.com/mlocati/docker-php-extension-installer
|
||||||
COPY --from=php_extension_installer --link /usr/bin/install-php-extensions /usr/local/bin/
|
COPY --from=mlocati/php-extension-installer:latest --link /usr/bin/install-php-extensions /usr/local/bin/
|
||||||
|
|
||||||
# persistent / runtime deps
|
# persistent / runtime deps
|
||||||
# hadolint ignore=DL3018
|
# hadolint ignore=DL3018
|
||||||
@ -79,7 +73,7 @@ CMD ["php-fpm"]
|
|||||||
ENV COMPOSER_ALLOW_SUPERUSER=1
|
ENV COMPOSER_ALLOW_SUPERUSER=1
|
||||||
ENV PATH="${PATH}:/root/.composer/vendor/bin"
|
ENV PATH="${PATH}:/root/.composer/vendor/bin"
|
||||||
|
|
||||||
COPY --from=composer --link /composer /usr/bin/composer
|
COPY --from=composer/composer:2-bin --link /composer /usr/bin/composer
|
||||||
|
|
||||||
# prevent the reinstallation of vendors at every changes in the source code
|
# prevent the reinstallation of vendors at every changes in the source code
|
||||||
COPY --link composer.* symfony.* ./
|
COPY --link composer.* symfony.* ./
|
||||||
|
Loading…
x
Reference in New Issue
Block a user