Spaces:
Runtime error
Runtime error
Update Dockerfile
Browse files- Dockerfile +4 -3
Dockerfile
CHANGED
|
@@ -24,10 +24,11 @@ RUN npm run build
|
|
| 24 |
# ── 3. Backend (Go) ───────────────────────────────────────
|
| 25 |
FROM golang:1.22-alpine AS backend
|
| 26 |
WORKDIR /app
|
|
|
|
| 27 |
COPY --from=unpacker /src/backend/go.mod /src/backend/go.sum ./
|
| 28 |
-
RUN go mod download
|
| 29 |
COPY --from=unpacker /src/backend/ .
|
| 30 |
-
RUN CGO_ENABLED=
|
| 31 |
go build -ldflags="-s -w" -o server ./cmd/server
|
| 32 |
|
| 33 |
# ── 4. Runtime ────────────────────────────────────────────
|
|
@@ -35,7 +36,7 @@ FROM python:3.11-slim
|
|
| 35 |
WORKDIR /app
|
| 36 |
|
| 37 |
RUN apt-get update && \
|
| 38 |
-
apt-get install -y --no-install-recommends ca-certificates && \
|
| 39 |
rm -rf /var/lib/apt/lists/*
|
| 40 |
|
| 41 |
# Go binary + frontend assets
|
|
|
|
| 24 |
# ── 3. Backend (Go) ───────────────────────────────────────
|
| 25 |
FROM golang:1.22-alpine AS backend
|
| 26 |
WORKDIR /app
|
| 27 |
+
RUN apk add --no-cache gcc musl-dev
|
| 28 |
COPY --from=unpacker /src/backend/go.mod /src/backend/go.sum ./
|
| 29 |
+
RUN go mod tidy && go mod download
|
| 30 |
COPY --from=unpacker /src/backend/ .
|
| 31 |
+
RUN CGO_ENABLED=1 GOOS=linux \
|
| 32 |
go build -ldflags="-s -w" -o server ./cmd/server
|
| 33 |
|
| 34 |
# ── 4. Runtime ────────────────────────────────────────────
|
|
|
|
| 36 |
WORKDIR /app
|
| 37 |
|
| 38 |
RUN apt-get update && \
|
| 39 |
+
apt-get install -y --no-install-recommends ca-certificates libgcc-s1 && \
|
| 40 |
rm -rf /var/lib/apt/lists/*
|
| 41 |
|
| 42 |
# Go binary + frontend assets
|