Files
flatrender/services/gateway/Dockerfile
T
soroush.asadi ee2a6b9b60
CI/CD / CI · Web (tsc) (push) Successful in 1m8s
CI/CD / Deploy · full stack (push) Failing after 7s
ci(build): pull Docker Hub base images via Nexus mirror + kargadan GOPROXY
Docker Hub blocks Iran (403) on the BUILD base images too (golang/alpine/busybox/
node) once they fall out of cache. Prefix every Docker Hub FROM/COPY --from with
mirror.soroushasadi.com/ (MCR dotnet images are reachable, left as-is). Go builders
also set GOPROXY=mirror.kargadan.ir/repository/go-group/ + GOSUMDB=off so any module/
toolchain fetch avoids the geo-blocked proxy.golang.org.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-12 16:24:38 +03:30

15 lines
599 B
Docker

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
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
FROM mirror.soroushasadi.com/alpine:3.20
RUN apk add --no-cache ca-certificates tzdata
WORKDIR /app
COPY --from=builder /app/gateway .
EXPOSE 8080
CMD ["./gateway"]