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