Files
api-gateway/Dockerfile
Björn Benouarets 31f5b4081a init: Initial commit
2026-02-05 18:37:35 +01:00

34 lines
551 B
Docker

# Build stage
FROM golang:1.25.5-alpine AS builder
WORKDIR /build
# Copy go mod files (for better caching)
COPY app/go.mod app/go.sum ./
RUN go mod download
# Copy source code
COPY app/ ./
# Build the application
RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o gateway .
# Runtime stage
FROM alpine:latest
RUN apk --no-cache add ca-certificates
WORKDIR /app
# Copy binary from builder
COPY --from=builder /build/gateway .
# Copy configuration
COPY gateway.yaml .
# Expose port
EXPOSE 8080
# Run the gateway
CMD ["./gateway"]