ee2a6b9b60
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>
14 lines
523 B
Docker
14 lines
523 B
Docker
FROM mirror.soroushasadi.com/golang:1.25-alpine AS builder
|
|
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 render-svc ./cmd/server
|
|
|
|
FROM mirror.soroushasadi.com/alpine:3.20
|
|
RUN apk add --no-cache ca-certificates tzdata
|
|
WORKDIR /app
|
|
COPY --from=builder /app/render-svc .
|
|
EXPOSE 8080
|
|
CMD ["./render-svc"]
|