Created
April 18, 2026 05:56
-
-
Save karthiks/0d8b5ef566e2439d011499e9f129616f to your computer and use it in GitHub Desktop.
Reference docker-compose file leveraging Bitfrost AI Gateway as service dependency for Claude Code dev container
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Build the image | |
| # Ref.: https://openrouter.ai/docs/guides/coding-agents/claude-code-integration | |
| # Bash: export ANTHROPIC_BASE_URL="http://bifrost:8080/anthropic" ANTHROPIC_API_KEY="" ANTHROPIC_AUTH_TOKEN="your-api-key-here" | |
| # PowerShell: $env:ANTHROPIC_BASE_URL="http://bifrost:8080/anthropic"; $env:ANTHROPIC_API_KEY=""; $env:ANTHROPIC_AUTH_TOKEN="your-api-key-here" | |
| # docker compose build | |
| # Launch the environment | |
| # The --rm flag ensures that once you type exit, the container instance is removed, keeping your Docker environment tidy. | |
| # docker compose run --rm claude-dhanj | |
| # Consistency: If you run docker ps, you'll see claude-dhanj. If you run docker images, you'll see claude-dhanj. | |
| # Volume Sync: Since your volume is mapped to ${PWD}, any code changes made by the Claude Code CLI inside the container will instantly appear on your host machine. | |
| # Memory Safety: The deploy block ensures that even if a Maven build or a heavy Node process spikes, it stays within your defined 8GB limit. | |
| networks: | |
| dock-network: | |
| driver: bridge | |
| services: | |
| # https://github.com/maximhq/bifrost/blob/main/examples/dockers/docker-compose.yml | |
| bifrost: | |
| image: maximhq/bifrost | |
| container_name: bitfrost | |
| ports: | |
| - "8080:8080" | |
| networks: | |
| - dock-network | |
| volumes: | |
| - "D:\\DockerWSL\\data\\bitfrost:/app/data" # Persist config data on the host | |
| # Uncomment for first run only: | |
| user: root # Run as root to avoid permission issues with mounted volumes. | |
| healthcheck: | |
| # test: ["CMD", "curl", "-f", "http://localhost:8080/health"] | |
| test: | |
| [ | |
| "CMD", | |
| "wget", | |
| "--no-verbose", | |
| "--tries=1", | |
| "-O", | |
| "/dev/null", | |
| "http://localhost:8080/health", | |
| ] | |
| interval: 15s | |
| timeout: 15s | |
| retries: 3 | |
| start_period: 10s | |
| restart: unless-stopped | |
| claude-dhanj: | |
| build: | |
| context: . | |
| dockerfile: Dockerfile.claude | |
| args: # Using Map syntax instead of List syntax | |
| ANTHROPIC_BASE_URL: ${ANTHROPIC_BASE_URL} | |
| ANTHROPIC_AUTH_TOKEN: ${ANTHROPIC_AUTH_TOKEN} | |
| ANTHROPIC_API_KEY: ${ANTHROPIC_API_KEY} | |
| image: claude-dhanj:latest | |
| container_name: claude-dhanj | |
| working_dir: /workspace | |
| networks: | |
| - dock-network | |
| volumes: | |
| - .:/workspace | |
| - ./.claude-plugins:/root/.claude/plugins | |
| environment: | |
| - ANTHROPIC_BASE_URL=${ANTHROPIC_BASE_URL} # Point to Bitfrost AI Gateway | |
| - ANTHROPIC_AUTH_TOKEN=${ANTHROPIC_AUTH_TOKEN} # Required, can be any string | |
| - COLORTERM=truecolor | |
| - TERM=xterm-256color | |
| deploy: | |
| resources: | |
| limits: | |
| memory: 8G | |
| reservations: | |
| memory: 6G | |
| depends_on: | |
| # - bifrost # Only waits for bifrost to start, not be ready | |
| bifrost: | |
| condition: service_healthy # Waits for health check to pass | |
| tty: true | |
| stdin_open: true | |
| entrypoint: ["/bin/bash"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment