Fix Dockerfile: use --legacy-peer-deps for npm install, simplify build stages

This commit is contained in:
David Alvarez
2026-05-23 18:07:25 +02:00
parent 1efd10f81f
commit 70fba6d14a
+3 -4
View File
@@ -3,16 +3,15 @@
# ─── Build frontend ───────────────────────────────
FROM node:20-alpine AS frontend-builder
WORKDIR /src
COPY frontend/package.json frontend/package-lock.json* ./
RUN npm ci 2>/dev/null || npm install
COPY frontend/package.json frontend/package-lock.json ./
RUN npm install --legacy-peer-deps
COPY frontend/ ./
RUN npm run build
# ─── Build Go binary ─────────────────────────────
FROM golang:1.23-alpine AS go-builder
WORKDIR /src
COPY go.mod go.sum ./
RUN go mod download 2>/dev/null || true
COPY go.mod ./
COPY *.go ./
COPY --from=frontend-builder /src/dist ./frontend/dist/
RUN CGO_ENABLED=0 go build -o /dostalgia .