Optimize Dockerfile

This change will only copy the `compose.{json|lock}` files prior to
installing the dependencies. This improves container image build time
when only code changed, as it facilitates image caching.
This commit is contained in:
Gereon Frey 2019-02-24 14:21:52 +01:00 committed by Stéphane Goetz
parent 63c336039b
commit 59fa9fb3ab

View File

@ -13,18 +13,19 @@ WORKDIR /daux
COPY --from=composer /usr/bin/composer /usr/bin/composer
# Copy files
COPY composer.json /daux/composer.json
COPY composer.lock /daux/composer.lock
RUN composer install --prefer-dist --no-ansi --no-dev --no-interaction --no-progress --no-scripts --optimize-autoloader
COPY bin/ /daux/bin/
COPY libs/ /daux/libs/
COPY templates/ /daux/templates/
COPY themes/ /daux/themes/
COPY tipuesearch/ /daux/tipuesearch/
COPY global.json /daux/global.json
COPY composer.json /daux/composer.json
COPY composer.lock /daux/composer.lock
COPY index.php /daux/index.php
RUN composer install --prefer-dist --no-ansi --no-dev --no-interaction --no-progress --no-scripts --optimize-autoloader
RUN ln -s /daux/bin/daux /usr/local/bin/daux
WORKDIR /build