Improve Docker build caching
First install the dependencies, then copy the files from the build context into the image. This allows for more caching during rebuilds when files change and rebuilds are much faster.
This commit is contained in:
parent
e3fa19b71e
commit
6a26165647
|
@ -35,10 +35,10 @@ RUN rm -f /app/import/* /app/config/config.php
|
||||||
# Build the PHP container
|
# Build the PHP container
|
||||||
FROM php:7-fpm-alpine
|
FROM php:7-fpm-alpine
|
||||||
WORKDIR /var/www
|
WORKDIR /var/www
|
||||||
COPY --from=data /app/ /var/www
|
|
||||||
RUN apk add --no-cache icu-dev gettext-dev && \
|
RUN apk add --no-cache icu-dev gettext-dev && \
|
||||||
docker-php-ext-install intl gettext pdo_mysql && \
|
docker-php-ext-install intl gettext pdo_mysql
|
||||||
chown -R www-data:www-data /var/www/import/ /var/www/storage/ && \
|
COPY --from=data /app/ /var/www
|
||||||
|
RUN chown -R www-data:www-data /var/www/import/ /var/www/storage/ && \
|
||||||
rm -r /var/www/html
|
rm -r /var/www/html
|
||||||
|
|
||||||
ENV TRUSTED_PROXIES 10.0.0.0/8,::ffff:10.0.0.0/8,\
|
ENV TRUSTED_PROXIES 10.0.0.0/8,::ffff:10.0.0.0/8,\
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
FROM node:8-alpine as themes
|
FROM node:8-alpine as themes
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
RUN apk add --no-cache yarn
|
||||||
COPY resources/assets/ /app/resources/assets
|
COPY resources/assets/ /app/resources/assets
|
||||||
COPY .babelrc package.json webpack.config.js /app/
|
COPY .babelrc package.json webpack.config.js /app/
|
||||||
RUN apk add --no-cache yarn
|
|
||||||
RUN yarn install
|
RUN yarn install
|
||||||
RUN yarn build
|
RUN yarn build
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue