Skip to content

Docker Compose

Local stack

The public Docker Compose path is intentionally minimal: create your own `docker-compose.yaml` for the gateway plus your app, or start from the public `docker-compose-minimal` example.

Use this page when:

  • you want to run LunarGate with Docker in a public, self-contained way
  • you want your own tiny docker-compose.yaml instead of the hosted install path
  • you want to colocate the gateway with one local app or test client

Minimal public layout

Create a small working directory like this:

my-lunargate-demo/
├── docker-compose.yaml
├── gateway.Dockerfile
├── config.yaml
└── .env

Then use a minimal compose file:

services:
  gateway:
    image: my-lunargate-gateway:local
    build:
      context: .
      dockerfile: gateway.Dockerfile
      pull: true
    ports:
      - "8080:8080"
    env_file:
      - .env

And a tiny wrapper Dockerfile:

FROM ghcr.io/lunargate-ai/gateway:latest
COPY config.yaml /app/config.yaml

For the config itself, the smallest working version is:

providers:
  openai:
    api_key: "${OPENAI_API_KEY}"

routing:
  routes:
    - name: "default"
      targets:
        - provider: openai
          model: gpt-5.2

And your .env can stay as small as:

OPENAI_API_KEY=sk-...

Start it

docker compose up --build

This gives you:

  • Gateway on http://127.0.0.1:8080

Smoke checks

curl http://127.0.0.1:8080/health
curl http://127.0.0.1:8080/v1/models

curl http://127.0.0.1:8080/v1/chat/completions \
  -H "Content-Type: application/json" \
  -d '{
    "model": "openai/gpt-5.2",
    "messages": [
      {"role": "user", "content": "Say hello from LunarGate Docker Compose."}
    ]
  }'

Why use the wrapper image pattern

Instead of bind-mounting config.yaml into the gateway container, the public example bakes the config into a tiny wrapper image.

That is more reliable on remote Docker contexts and avoids host-specific path problems.

If you also want an app beside the gateway

At that point, either:

  • add your own app service to the same compose file
  • or start from the public Docker Compose minimal example and adapt it
  1. Read Docker Compose minimal for the ready-made public example with a tiny app.
  2. Read Quickstart if you do not actually need Docker for your first run.
  3. Read Configuration overview before extending this minimal compose setup beyond one provider and one route.