first commit

This commit is contained in:
Beyhan Ogur
2026-05-11 15:08:50 +03:00
commit a408821410
47 changed files with 4670 additions and 0 deletions
+34
View File
@@ -0,0 +1,34 @@
# Build stage
FROM golang:1.24-alpine AS builder
WORKDIR /app
# Copy dependency files first for layer caching
COPY go.mod go.sum ./
RUN go mod download
# Copy source
COPY . .
# Build binary
RUN CGO_ENABLED=0 GOOS=linux go build -ldflags="-w -s" -o /gateway ./main.go
# ─────────────────────────────────────────────
# Runtime stage
FROM alpine:3.21
RUN apk --no-cache add ca-certificates tzdata
WORKDIR /app
# Copy binary and swagger docs
COPY --from=builder /gateway .
COPY --from=builder /app/docs ./docs
# Non-root user for security
RUN addgroup -S gateway && adduser -S gateway -G gateway
USER gateway
EXPOSE 8000
ENTRYPOINT ["/app/gateway"]