
Claude Code — Amazon Q Developer to Claude API bridge with production-ready containerized deployment.
┌─────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐ │ Docker Compose Stack │ ├──────────────────┬──────────────────────┬────────────────────────────┬─────────────────────────────────────────┤ │ POSTGRES │ BACKEND │ FRONTEND │ OBSERVABILITY STACK │ │ (PostgreSQL 16) │ (Python 3.11) │ (Node.js 20) │ │ │ │ │ │ ┌─────────────────────────────────────┐ │ │ ┌────────────┐ │ ┌───────────────┐ │ ┌──────────────────┐ │ │ Grafana (3001) - Dashboards │ │ │ │ PostgreSQL │◄─┼──│ FastAPI Server│◄──┼──│ Next.js 16 App │ │ │ Prometheus (9090) - Metrics │ │ │ │ Database │ │ │ Amazon Q Bridge│ │ │ React 19 UI │ │ │ Loki (3100) - Log Aggregation │ │ │ └────────────┘ │ │ + Metrics │ │ └──────────────────┘ │ │ Jaeger (16686) - Tracing │ │ │ │ │ │ (Port 9464) │ │ │ │ │ Promtail - Log Shipping │ │ │ ▼ │ └───────────────┘ │ ▼ │ └─────────────────────────────────────┘ │ │ Port 5432 │ Port 8000 │ Port 3000 │ │ └──────────────────┴──────────────────────┴────────────────────────────┴─────────────────────────────────────────┘ │ │ ▼ ▼ ┌──────────────┐ ┌─────────────────┐ │ postgres_data│ │ Observability │ │ Volume │ │ Data Volumes: │ └──────────────┘ │ - loki_data │ │ - prometheus_data│ │ - grafana_data │ └─────────────────┘
bashdocker pull justinluu132/claude-code:latest
📦 Docker Hub: https://hub.docker.com/r/justinluu132/claude-code
Create a .env file in the project root:
bash# Required ADMIN_PASSWORD="your-secure-password" # Mode Configuration MODE="development" # "development" or "production" # Optional - Database # Note: docker-compose.yml sets DATABASE_URL to PostgreSQL by default # You can override it here if needed: # DATABASE_URL="" # Empty = SQLite (./data/data.sqlite3) # DATABASE_URL="postgresql://user:pass@host/db" # Custom PostgreSQL # DATABASE_URL="mysql://user:pass@host/db" # MySQL # Optional - Advanced MAX_ERROR_COUNT=100 TOKEN_COUNT_MULTIPLIER=1.0 HTTP_PROXY="" SSL_VERIFY="true" # Set to "false" to disable SSL verification ENABLE_CONSOLE="true" FRONTEND_URL="http://localhost:3000" PORT=8000
bash# Start all services docker-compose up -d # View logs docker-compose logs -f # Stop services docker-compose down
| Service | URL | Purpose |
|---|---|---|
| Frontend | http://localhost:3000 | Modern Chat Interface |
| Chat UI | http://localhost:3000/chat | Full ***-style UI |
| Backend | http://localhost:8000 | Claude API Bridge |
| Admin | http://localhost:3000 | Token & Account Management |
| Observability Stack | ||
| Grafana | http://localhost:3001 | Dashboards & Visualization |
| Prometheus | http://localhost:9090 | Metrics Collection |
| Jaeger | http://localhost:*** | Distributed Tracing |
| Loki | http://localhost:3100 | Log Aggregation |
| Metrics | http://localhost:9464/metrics | Application Metrics |
yamlpostgres: image: postgres:16-alpine environment: POSTGRES_DB: claude_code POSTGRES_USER: claude_user POSTGRES_PASSWORD: claude_password volumes: - postgres_data:/var/lib/postgresql/data ports: - "5432:5432" healthcheck: test: ["CMD-SHELL", "pg_isready -U claude_user -d claude_code"] interval: 10s timeout: 5s retries: 5 restart: unless-stopped
Features:
yamlbackend: build: . ports: - "8000:8000" - "9464:9464" # Prometheus metrics env_file: - .env environment: - DATABASE_URL=postgresql://claude_user:claude_password@postgres:5432/claude_code - JAEGER_HOST=jaeger - LOKI_URL=http://loki:3100 depends_on: postgres: condition: service_healthy jaeger: condition: service_started loki: condition: service_started restart: unless-stopped logging: driver: "json-file" options: max-size: "10m" max-file: "3" labels: "service,environment" tag: "{{.Name}}/{{.ID}}"
Features:
/v1/messages)/healthzapp)yamlfrontend: build: context: ./frontend args: BACKEND_URL: http://backend:8000 ports: - "3000:3000" environment: - BACKEND_URL=http://backend:8000 depends_on: - backend restart: unless-stopped
Features:
nextjs)Jaeger - Distributed Tracing
yamljaeger: image: jaegertracing/all-in-one:1.50 ports: - "16686:16686" # UI - "6831:6831/udp" # Agent (thrift) - "14268:14268" # Collector HTTP environment: - COLLECTOR_ZIPKIN_HOST_PORT=:9411 - COLLECTOR_OTLP_ENABLED=true restart: unless-stopped
Grafana Loki - Log Aggregation
yamlloki: image: grafana/loki:2.9.0 ports: - "3100:3100" command: -config.file=/etc/loki/local-config.yaml volumes: - loki_data:/loki - ./observability/loki-config.yaml:/etc/loki/local-config.yaml:ro restart: unless-stopped
Promtail - Log Shipper
yamlpromtail: image: grafana/promtail:2.9.0 volumes: - /var/lib/docker/containers:/var/lib/docker/containers:ro - /var/run/docker.sock:/var/run/docker.sock:ro - ./observability/promtail-config.yaml:/etc/promtail/config.yaml:ro command: -config.file=/etc/promtail/config.yaml depends_on: - loki restart: unless-stopped
Prometheus - Metrics Collection
yamlprometheus: image: prom/prometheus:v2.47.0 ports: - "9090:9090" command: - '--config.file=/etc/prometheus/prometheus.yml' - '--storage.tsdb.path=/prometheus' - '--web.console.libraries=/usr/share/prometheus/console_libraries' - '--web.console.templates=/usr/share/prometheus/consoles' volumes: - ./observability/prometheus.yml:/etc/prometheus/prometheus.yml:ro - prometheus_data:/prometheus restart: unless-stopped
Grafana - Visualization and Dashboards
yamlgrafana: image: grafana/grafana:10.1.0 ports: - "3001:3000" environment: - GF_SECURITY_ADMIN_PASSWORD=admin - GF_USERS_ALLOW_SIGN_UP=false - GF_SERVER_ROOT_URL=http://localhost:3001 volumes: - grafana_data:/var/lib/grafana - ./observability/grafana/provisioning:/etc/grafana/provisioning:ro depends_on: - prometheus - loki - jaeger restart: unless-stopped
yamlvolumes: postgres_data: loki_data: prometheus_data: grafana_data:
The Docker Compose setup uses named volumes for data persistence:
postgres_data - PostgreSQL database storageloki_data - Loki log storageprometheus_data - Prometheus metrics storagegrafana_data - Grafana dashboards and configurationbash# PostgreSQL (Docker Compose default) DATABASE_URL="postgresql://claude_user:claude_password@postgres:5432/claude_code" # SQLite (alternative - requires ./data directory mount) DATABASE_URL="" # MySQL (alternative) DATABASE_URL="mysql://user:password@host:3306/dbname"
bash# PostgreSQL backup (Docker Compose default) docker-compose exec postgres pg_dump -U claude_user claude_code > backup_$(date +%Y%m%d).sql # Restore PostgreSQL backup cat backup_20231201.sql | docker-compose exec -T postgres psql -U claude_user claude_code # For SQLite (if using DATABASE_URL="") docker-compose stop backend cp ./data/data.sqlite3 ./backup/data.sqlite3.$(date +%Y%m%d) docker-compose start backend
dockerfileHEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \ CMD python -c "import urllib.request; urllib.request.urlopen('http://localhost:8000/healthz')"
bash# View health status docker-compose ps # Check specific container docker inspect --format='{{.State.Health.Status}}' claude-code-backend-1 # Monitor system health curl http://localhost:8000/healthz
| Variable | Default | Description |
|---|---|---|
MODE | development | Application mode (dev/prod) |
ADMIN_PASSWORD | admin | Web console admin password |
DATABASE_URL | (empty) | Database connection (empty = SQLite) |
MAX_ERROR_COUNT | 100 | Auto-disable account threshold |
TOKEN_COUNT_MULTIPLIER | 1.0 | Token pricing multiplier |
HTTP_PROXY | (empty) | HTTP proxy for outbound requests |
SSL_VERIFY | true | SSL certificate verification |
ENABLE_CONSOLE | true | Enable web management console |
FRONTEND_URL | http://localhost:3000 | Frontend URL for redirects |
PORT | 8000 | Backend server port |
BACKEND_URL | http://backend:8000 | Backend URL (frontend container) |
| Observability Variables | ||
JAEGER_HOST | jaeger | Jaeger tracing host |
LOKI_URL | http://loki:3100 | Loki log aggregation URL |
GF_SECURITY_ADMIN_PASSWORD | admin | Grafana admin password |
bash# Chat completions (Claude API compatible) POST /v1/messages # Streaming support POST /v1/messages (with stream: true)
bash# Account management GET/POST/PUT/DELETE /api/accounts # Token management with scopes GET/POST/PUT/DELETE /api/tokens # Conversation management GET/POST/PUT/DELETE /api/conversations # Authentication POST /api/auth/login POST /api/auth/refresh
yaml# docker-compose.prod.yml services: postgres: image: postgres:16-alpine environment: POSTGRES_DB: claude_code POSTGRES_USER: claude_user POSTGRES_PASSWORD: ${POSTGRES_PASSWORD} volumes: - postgres_data:/var/lib/postgresql/data # No external port exposure - internal only healthcheck: test: ["CMD-SHELL", "pg_isready -U claude_user -d claude_code"] interval: 10s timeout: 5s retries: 5 restart: unless-stopped backend: build: . expose: - "8000" environment: - MODE=production - DATABASE_URL=postgresql://claude_user:${POSTGRES_PASSWORD}@postgres:5432/claude_code depends_on: postgres: condition: service_healthy # Remove ports mapping - only internal access frontend: build: context: ./frontend args: BACKEND_URL: http://backend:8000 expose: - "3000" depends_on: - backend # Remove ports mapping - only internal access nginx: image: nginx:alpine ports: - "80:80" - "443:443" volumes: - ./nginx.conf:/etc/nginx/nginx.conf:ro - ./certs:/etc/nginx/certs:ro depends_on: - frontend - backend volumes: postgres_data:
yamlservices: postgres: deploy: resources: limits: cpus: '1' memory: 512M reservations: cpus: '0.25' memory: 128M backend: deploy: resources: limits: cpus: '2' memory: 1G reservations: cpus: '0.5' memory: 256M frontend: deploy: resources: limits: cpus: '1' memory: 512M reservations: cpus: '0.25' memory: 128M
bash# Pull latest image docker pull justinluu132/claude-code:latest # Start services (detached) docker-compose up -d # View logs docker-compose logs -f docker-compose logs -f postgres docker-compose logs -f backend docker-compose logs -f frontend # Stop services docker-compose down # Restart a service docker-compose restart backend docker-compose restart postgres # Rebuild and restart docker-compose up -d --build # Remove all data (⚠️ destructive) docker-compose down -v # Shell into containers docker-compose exec postgres /bin/bash docker-compose exec backend /bin/bash docker-compose exec frontend /bin/sh # Check resource usage docker stats # Database operations (PostgreSQL) docker-compose exec postgres psql -U claude_user -d claude_code # Database operations (SQLite - if using DATABASE_URL="") docker-compose exec backend sqlite3 /app/data/data.sqlite3
bash# Check logs for all services docker-compose logs postgres docker-compose logs backend docker-compose logs frontend # Verify .env file exists and has correct MODE cat .env # Check port conflicts lsof -i :5432 lsof -i :8000 lsof -i :3000
bash# Check PostgreSQL is running and healthy docker-compose ps postgres # Check PostgreSQL logs docker-compose logs postgres # Test PostgreSQL connection docker-compose exec postgres pg_isready -U claude_user -d claude_code # For SQLite (if using DATABASE_URL="") mkdir -p ./data chmod 755 ./data
bash# Verify backend is healthy curl http://localhost:8000/healthz # Check internal network docker-compose exec frontend wget -q -O - http://backend:8000/healthz # Verify API endpoints curl http://localhost:8000/v1/messages -X POST -H "Content-Type: application/json"
bash# Check MODE setting docker-compose exec backend env | grep MODE # Verify admin password curl -X POST http://localhost:8000/api/auth/login \ -H "Content-Type: application/json" \ -d '{"username":"admin","password":"your-password"}'
| Image | Size (approx.) | Contents |
|---|---|---|
| PostgreSQL | ~90 MB | PostgreSQL 16 Alpine |
| Backend | ~180 MB | Python 3.11 slim + compiled bytecode |
| Frontend | ~140 MB | Node.js 20 slim + standalone build |
/v1/messages)For questions, issues, or support:
📧 Email: ***
Claude Code — A sophisticated bridge converting Amazon Q Developer into Claude API compatibility.
您可以使用以下命令拉取该镜像。请将 <标签> 替换为具体的标签版本。如需查看所有可用标签版本,请访问 标签列表页面。




探索更多轩辕镜像的使用方法,找到最适合您系统的配置方式
通过 Docker 登录认证访问私有仓库
无需登录使用专属域名
Kubernetes 集群配置 Containerd
K3s 轻量级 Kubernetes 镜像加速
VS Code Dev Containers 配置
Podman 容器引擎配置
HPC 科学计算容器配置
ghcr、Quay、nvcr 等镜像仓库
Harbor Proxy Repository 对接专属域名
Portainer Registries 加速拉取
Nexus3 Docker Proxy 内网缓存
需要其他帮助?请查看我们的 常见问题Docker 镜像访问常见问题解答 或 提交工单
docker search 限制
站内搜不到镜像
离线 save/load
插件要用 plugin install
WSL 拉取慢
安全与 digest
新手拉取配置
镜像合规机制
manifest unknown
no matching manifest(架构)
invalid tar header(解压)
TLS 证书失败
DNS 超时
域名连通性排查
410 Gone 排查
402 与流量用尽
401 认证失败
429 限流
D-Bus 凭证提示
413 与超大单层
来自真实用户的反馈,见证轩辕镜像的优质服务