Skip to content

Commit

Permalink
refactor: simplify Dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
dunglas committed May 23, 2023
1 parent 61eee04 commit 3a9a266
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,6 @@
# https://docs.docker.com/develop/develop-images/multistage-build/#stop-at-a-specific-build-stage
# 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
# Temporary fix for https://github.com/dunglas/mercure/issues/770
FROM caddy:2.7-builder-alpine AS app_caddy_builder
Expand All @@ -34,7 +28,7 @@ ENV APP_ENV=prod
WORKDIR /srv/app

# 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
# hadolint ignore=DL3018
Expand Down Expand Up @@ -79,7 +73,7 @@ CMD ["php-fpm"]
ENV COMPOSER_ALLOW_SUPERUSER=1
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
COPY --link composer.* symfony.* ./
Expand Down

0 comments on commit 3a9a266

Please sign in to comment.