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 ───────────────────────────────
|
# ─── Build frontend ───────────────────────────────
|
||||||
FROM node:20-alpine AS frontend-builder
|
FROM node:20-alpine AS frontend-builder
|
||||||
WORKDIR /src
|
WORKDIR /src
|
||||||
COPY frontend/package.json frontend/package-lock.json* ./
|
COPY frontend/package.json frontend/package-lock.json ./
|
||||||
RUN npm ci 2>/dev/null || npm install
|
RUN npm install --legacy-peer-deps
|
||||||
COPY frontend/ ./
|
COPY frontend/ ./
|
||||||
RUN npm run build
|
RUN npm run build
|
||||||
|
|
||||||
# ─── Build Go binary ─────────────────────────────
|
# ─── Build Go binary ─────────────────────────────
|
||||||
FROM golang:1.23-alpine AS go-builder
|
FROM golang:1.23-alpine AS go-builder
|
||||||
WORKDIR /src
|
WORKDIR /src
|
||||||
COPY go.mod go.sum ./
|
COPY go.mod ./
|
||||||
RUN go mod download 2>/dev/null || true
|
|
||||||
COPY *.go ./
|
COPY *.go ./
|
||||||
COPY --from=frontend-builder /src/dist ./frontend/dist/
|
COPY --from=frontend-builder /src/dist ./frontend/dist/
|
||||||
RUN CGO_ENABLED=0 go build -o /dostalgia .
|
RUN CGO_ENABLED=0 go build -o /dostalgia .
|
||||||
|
|||||||
Reference in New Issue
Block a user