> ## Documentation Index
> Fetch the complete documentation index at: https://x402-stellar.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Docker Deployment

> Deploying the Go reverse proxy as a container or sidecar

## Dockerfile

The repository includes a multi-stage Dockerfile producing a static binary container:

```dockerfile theme={null}
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"]
```

## Docker Compose

Run the proxy alongside an upstream service:

```yaml theme={null}
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"
```
