refactor: clone repo from Gitea in Dockerfile instead of COPY

Replace local COPY with git clone --depth 1 so the image can be built
without a local source context. Adds BRANCH build arg (default: main).
This commit is contained in:
2026-02-18 20:12:05 +01:00
parent a3e7f0288e
commit 16848bfdf0
2 changed files with 11 additions and 9 deletions

View File

@@ -1,10 +1,10 @@
FROM node:alpine AS build
WORKDIR /app
RUN apk add --no-cache git
COPY package.json package-lock.json tsconfig.json ./
COPY packages/shared/ packages/shared/
COPY apps/server/ apps/server/
ARG BRANCH=main
WORKDIR /app
RUN git clone --branch ${BRANCH} --depth 1 https://gitea.gilmour109.de/Gilmour109/calchat.git .
RUN npm ci --workspace=@calchat/server --workspace=@calchat/shared --include-workspace-root
@@ -15,9 +15,9 @@ FROM node:alpine
WORKDIR /app
COPY package.json package-lock.json ./
COPY packages/shared/package.json packages/shared/
COPY apps/server/package.json apps/server/
COPY --from=build /app/package.json /app/package-lock.json ./
COPY --from=build /app/packages/shared/package.json packages/shared/
COPY --from=build /app/apps/server/package.json apps/server/
RUN npm ci --omit=dev --workspace=@calchat/server --workspace=@calchat/shared --include-workspace-root