From 5b606936c3f7b0dc1232ad269f3666f8170c6e11 Mon Sep 17 00:00:00 2001 From: kolaente Date: Fri, 30 Sep 2022 19:13:06 +0200 Subject: [PATCH] fix: docker build --- Dockerfile | 30 ++++++++++-------------------- 1 file changed, 10 insertions(+), 20 deletions(-) diff --git a/Dockerfile b/Dockerfile index bc702b12..a12177e5 100644 --- a/Dockerfile +++ b/Dockerfile @@ -6,34 +6,24 @@ WORKDIR /build ARG USE_RELEASE=false ARG RELEASE_VERSION=main +ENV PNPM_CACHE_FOLDER .cache/pnpm/ +ADD . ./ + RUN \ if [ $USE_RELEASE = true ]; then \ wget https://dl.vikunja.io/frontend/vikunja-frontend-$RELEASE_VERSION.zip -O frontend-release.zip && \ unzip frontend-release.zip -d dist/ && \ exit 0; \ - fi - -ENV PNPM_CACHE_FOLDER .cache/pnpm/ - -# pnpm fetch does require only lockfile -COPY pnpm-lock.yaml ./ - -RUN \ + fi && \ # https://pnpm.io/installation#using-corepack corepack enable && \ - # we don't use corepack prepare here by intend since - # we have renovate to keep our dependencies up to date + # we don't use corepack prepare here by intend since + # we have renovate to keep our dependencies up to date # Build the frontend - pnpm fetch --prod - -ADD . ./ - -RUN apk add --no-cache git - -RUN \ - pnpm install -r --offline --prod && \ - echo '{"VERSION": "'$(git describe --tags --always --abbrev=10 | sed 's/-/+/' | sed 's/^v//' | sed 's/-g/-/')'"}' > src/version.json && \ - pnpm run build + pnpm install && \ + apk add --no-cache git && \ + echo '{"VERSION": "'$(git describe --tags --always --abbrev=10 | sed 's/-/+/' | sed 's/^v//' | sed 's/-g/-/')'"}' > src/version.json && \ + pnpm run build # Stage 2: copy FROM nginx:alpine