Last active
June 15, 2023 01:14
-
-
Save ciaranmcnulty/1edcc70d3016a7927faec094ca307e9e to your computer and use it in GitHub Desktop.
PHP Dockerfile with composer target
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM php:7.2.10-fpm-alpine3.8 AS base | |
# Stuff needed in all layers | |
RUN apk add --no-cache gettext fcgi icu-dev | |
RUN docker-php-ext-install bcmath | |
FROM base AS dependencies | |
COPY --from=composer:1.7 /usr/bin/composer /usr/bin/composer | |
COPY composer.json /app/composer.json | |
WORKDIR /app | |
RUN composer install -a -o --no-dev | |
FROM base as prod | |
# Assumes /vendor is in .dockerignore | |
COPY --from=dependencies /app/vendor /app/vendor | |
COPY . /app/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment