Initial cloud-services repo - gateway service + pkg modules

This commit is contained in:
Chris Rai
2026-01-30 23:14:52 -05:00
commit fbb820d7b3
1037 changed files with 171318 additions and 0 deletions

35
Dockerfile Normal file
View File

@@ -0,0 +1,35 @@
# Multi-service Dockerfile with build caching
# Usage: docker build --build-arg SERVICE=gateway -t cloud-gateway .
ARG SERVICE=gateway
# Build stage
FROM golang:1.24-alpine AS builder
RUN apk add --no-cache git ca-certificates
WORKDIR /src
# Cache dependencies first (changes less often)
COPY go.work go.work.sum* ./
COPY pkg/go.mod pkg/go.sum* ./pkg/
COPY services/${SERVICE}/go.mod services/${SERVICE}/go.sum* ./services/${SERVICE}/
RUN go mod download
# Copy source and build
COPY pkg/ ./pkg/
COPY services/${SERVICE}/ ./services/${SERVICE}/
WORKDIR /src/services/${SERVICE}
RUN CGO_ENABLED=0 GOOS=linux go build -ldflags="-s -w" -o /app .
# Runtime stage
FROM alpine:3.20
RUN apk add --no-cache ca-certificates tzdata
COPY --from=builder /app /app
USER nobody:nobody
ENTRYPOINT ["/app"]