Fix Dockerfile: use --legacy-peer-deps for npm install, simplify build stages
This commit is contained in:
+3
-4
@@ -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 .
|
||||
|
||||
Reference in New Issue
Block a user