revert: backend Dockerfile just copies the locally-built server binary, no in-container Go build
This commit is contained in:
+1
-14
@@ -1,16 +1,3 @@
|
||||
# ---- مرحلهی build ----
|
||||
FROM golang:1.25-alpine AS builder
|
||||
WORKDIR /app
|
||||
|
||||
RUN sed -i 's|dl-cdn.alpinelinux.org|mirror.mobinhost.com|g' /etc/apk/repositories
|
||||
|
||||
COPY go.mod go.sum ./
|
||||
RUN go mod download
|
||||
|
||||
COPY . .
|
||||
RUN CGO_ENABLED=0 GOOS=linux go build -ldflags="-s -w" -o /out/server ./cmd/api
|
||||
|
||||
# ---- مرحلهی اجرا (ایمیج نهایی سبک) ----
|
||||
FROM alpine:3.20
|
||||
|
||||
RUN sed -i 's|dl-cdn.alpinelinux.org|mirror.mobinhost.com|g' /etc/apk/repositories \
|
||||
@@ -18,7 +5,7 @@ RUN sed -i 's|dl-cdn.alpinelinux.org|mirror.mobinhost.com|g' /etc/apk/repositori
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
COPY --from=builder /out/server ./server
|
||||
COPY server ./server
|
||||
RUN chmod +x /app/server
|
||||
|
||||
RUN mkdir -p /app/uploads/photos
|
||||
|
||||
Reference in New Issue
Block a user