Go Reverse Proxy
Docker Deployment
Deploying the Go reverse proxy as a container or sidecar
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Deploying the Go reverse proxy as a container or sidecar
FROM golang:1.23-alpine AS builder
WORKDIR /app
COPY proxy/go.mod proxy/go.sum ./
RUN go mod download
COPY proxy/ ./
RUN CGO_ENABLED=0 GOOS=linux go build -ldflags="-s -w" -o /gateway ./cmd/gateway/main.go
FROM scratch
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
COPY --from=builder /gateway /gateway
EXPOSE 8080
ENTRYPOINT ["/gateway"]
version: '3.8'
services:
gateway:
build:
context: .
dockerfile: deploy/Dockerfile
ports:
- "8080:8080"
volumes:
- ./config.yaml:/config.yaml
command: ["/gateway", "--config", "/config.yaml"]
depends_on:
- api-service
api-service:
image: my-upstream-api:latest
ports:
- "5000:5000"