fix: docker build
This commit is contained in:
parent
d120e8c82d
commit
5b606936c3
1 changed files with 10 additions and 20 deletions
30
Dockerfile
30
Dockerfile
|
@ -6,34 +6,24 @@ WORKDIR /build
|
||||||
ARG USE_RELEASE=false
|
ARG USE_RELEASE=false
|
||||||
ARG RELEASE_VERSION=main
|
ARG RELEASE_VERSION=main
|
||||||
|
|
||||||
|
ENV PNPM_CACHE_FOLDER .cache/pnpm/
|
||||||
|
ADD . ./
|
||||||
|
|
||||||
RUN \
|
RUN \
|
||||||
if [ $USE_RELEASE = true ]; then \
|
if [ $USE_RELEASE = true ]; then \
|
||||||
wget https://dl.vikunja.io/frontend/vikunja-frontend-$RELEASE_VERSION.zip -O frontend-release.zip && \
|
wget https://dl.vikunja.io/frontend/vikunja-frontend-$RELEASE_VERSION.zip -O frontend-release.zip && \
|
||||||
unzip frontend-release.zip -d dist/ && \
|
unzip frontend-release.zip -d dist/ && \
|
||||||
exit 0; \
|
exit 0; \
|
||||||
fi
|
fi && \
|
||||||
|
|
||||||
ENV PNPM_CACHE_FOLDER .cache/pnpm/
|
|
||||||
|
|
||||||
# pnpm fetch does require only lockfile
|
|
||||||
COPY pnpm-lock.yaml ./
|
|
||||||
|
|
||||||
RUN \
|
|
||||||
# https://pnpm.io/installation#using-corepack
|
# https://pnpm.io/installation#using-corepack
|
||||||
corepack enable && \
|
corepack enable && \
|
||||||
# we don't use corepack prepare here by intend since
|
# we don't use corepack prepare here by intend since
|
||||||
# we have renovate to keep our dependencies up to date
|
# we have renovate to keep our dependencies up to date
|
||||||
# Build the frontend
|
# Build the frontend
|
||||||
pnpm fetch --prod
|
pnpm install && \
|
||||||
|
apk add --no-cache git && \
|
||||||
ADD . ./
|
echo '{"VERSION": "'$(git describe --tags --always --abbrev=10 | sed 's/-/+/' | sed 's/^v//' | sed 's/-g/-/')'"}' > src/version.json && \
|
||||||
|
pnpm run build
|
||||||
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
|
|
||||||
|
|
||||||
# Stage 2: copy
|
# Stage 2: copy
|
||||||
FROM nginx:alpine
|
FROM nginx:alpine
|
||||||
|
|
Loading…
Reference in a new issue