2026-06-12 16:24:38 +03:30
|
|
|
FROM mirror.soroushasadi.com/golang:1.25-alpine AS builder
|
|
|
|
|
# Go module/toolchain fetches via the kargadan Nexus (proxy.golang.org geo-blocked).
|
|
|
|
|
ENV GOPROXY=https://mirror.kargadan.ir/repository/go-group/ GOSUMDB=off
|
2026-05-29 23:29:31 +03:30
|
|
|
WORKDIR /app
|
|
|
|
|
# Dependencies are vendored — build fully offline (proxy.golang.org is geo-blocked from some regions)
|
|
|
|
|
COPY . .
|
|
|
|
|
RUN CGO_ENABLED=0 GOOS=linux go build -mod=vendor -ldflags="-s -w" -o gateway ./cmd/server
|
|
|
|
|
|
2026-06-12 16:24:38 +03:30
|
|
|
FROM mirror.soroushasadi.com/alpine:3.20
|
2026-05-29 23:29:31 +03:30
|
|
|
RUN apk add --no-cache ca-certificates tzdata
|
|
|
|
|
WORKDIR /app
|
|
|
|
|
COPY --from=builder /app/gateway .
|
|
|
|
|
EXPOSE 8080
|
|
|
|
|
CMD ["./gateway"]
|