Include yarn.lock to speed up builds

This commit is contained in:
Leonard Jonathan Oh 2023-03-21 02:38:15 +00:00
parent 47072710b2
commit 9a4496ea09
2 changed files with 4495 additions and 1 deletions

View file

@ -2,9 +2,10 @@ FROM alpine:3.15 AS builder
RUN apk add --no-cache npm
RUN npm install -g gulp yarn
RUN apk add --no-cache php7 php7-json php-phar php-zip
COPY . /source
WORKDIR /source
COPY package.json yarn.lock .
RUN yarn install
COPY . .
# Patch release.php with hotfix from: https://github.com/xgbstar1/snappymail-docker/blob/main/Dockerfile, so that release.php doesn't fail with error
RUN sed -i 's_^if.*rename.*snappymail.v.0.0.0.*$_if (!!system("mv snappymail/v/0.0.0 snappymail/v/{$package->version}")) {_' cli/release.php || true
RUN php release.php