Skip to content

Commit fb9b86d

Browse files
authored
Merge pull request #48 from aricodes-oss/main
Add Docker support, multi-platform CI
2 parents ab8566a + e0ede8e commit fb9b86d

File tree

4 files changed

+175
-1
lines changed

4 files changed

+175
-1
lines changed

.dockerignore

Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
# Git
2+
.git
3+
.gitignore
4+
.gitattributes
5+
6+
7+
# CI
8+
.codeclimate.yml
9+
.travis.yml
10+
.taskcluster.yml
11+
12+
# Docker
13+
docker-compose.yml
14+
Dockerfile
15+
.docker
16+
.dockerignore
17+
18+
# Byte-compiled / optimized / DLL files
19+
**/__pycache__/
20+
**/*.py[cod]
21+
22+
# C extensions
23+
*.so
24+
25+
# Distribution / packaging
26+
.Python
27+
env/
28+
build/
29+
develop-eggs/
30+
dist/
31+
downloads/
32+
eggs/
33+
lib/
34+
lib64/
35+
parts/
36+
sdist/
37+
var/
38+
*.egg-info/
39+
.installed.cfg
40+
*.egg
41+
42+
# PyInstaller
43+
# Usually these files are written by a python script from a template
44+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
45+
*.manifest
46+
*.spec
47+
48+
# Installer logs
49+
pip-log.txt
50+
pip-delete-this-directory.txt
51+
52+
# Unit test / coverage reports
53+
htmlcov/
54+
.tox/
55+
.coverage
56+
.cache
57+
nosetests.xml
58+
coverage.xml
59+
60+
# Translations
61+
*.mo
62+
*.pot
63+
64+
# Django stuff:
65+
*.log
66+
67+
# Sphinx documentation
68+
docs/_build/
69+
70+
# PyBuilder
71+
target/
72+
73+
# Virtual environment
74+
.env
75+
.venv/
76+
venv/
77+
78+
# PyCharm
79+
.idea
80+
81+
# Python mode for VIM
82+
.ropeproject
83+
**/.ropeproject
84+
85+
# Vim swap files
86+
**/*.swp
87+
88+
# VS Code
89+
.vscode/

.github/workflows/publish.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: publish
2+
on:
3+
push:
4+
branches:
5+
- main
6+
7+
jobs:
8+
publish:
9+
runs-on: ubuntu-latest
10+
permissions:
11+
packages: write
12+
contents: read
13+
14+
steps:
15+
- uses: actions/checkout@main
16+
- name: Set up QEMU
17+
uses: docker/setup-qemu-action@master
18+
with:
19+
platforms: all
20+
- name: Set up Docker Buildx
21+
id: buildx
22+
uses: docker/setup-buildx-action@master
23+
24+
- name: Log in to Github's container registry
25+
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u $ --password-stdin
26+
27+
# Docker images have to have lowercase names, and Github Actions doesn't
28+
# have template functions
29+
- name: Collect image metadata
30+
id: meta
31+
uses: docker/metadata-action@master
32+
with:
33+
images: ghcr.io/${{ github.repository_owner }}/${{ github.event.repository.name }}
34+
35+
- name: Build
36+
uses: docker/build-push-action@master
37+
with:
38+
context: .
39+
file: ./Dockerfile
40+
platforms: linux/amd64,linux/arm64
41+
push: true
42+
tags: ${{ steps.meta.outputs.tags }}

Dockerfile

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
FROM python:latest
2+
3+
WORKDIR /claude-code-proxy
4+
5+
# Copy package specifications
6+
COPY pyproject.toml uv.lock ./
7+
8+
# Install uv and project dependencies
9+
RUN pip install --upgrade uv && uv sync --locked
10+
11+
# Copy project code to current directory
12+
COPY . .
13+
14+
# Start the proxy
15+
EXPOSE 8082
16+
CMD uv run uvicorn server:app --host 0.0.0.0 --port 8082 --reload

README.md

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ A proxy server that lets you use Anthropic clients with Gemini, OpenAI, or Anthr
1717

1818
### Setup 🛠️
1919

20+
#### From source
21+
2022
1. **Clone this repository**:
2123
```bash
2224
git clone https://github.com/1rgs/claude-code-proxy.git
@@ -54,6 +56,31 @@ A proxy server that lets you use Anthropic clients with Gemini, OpenAI, or Anthr
5456
```
5557
*(`--reload` is optional, for development)*
5658

59+
#### Docker
60+
61+
If using docker, download the example environment file to `.env` and edit it as described above.
62+
```bash
63+
curl -O .env https://raw.githubusercontent.com/1rgs/claude-code-proxy/refs/heads/main/.env.example
64+
```
65+
66+
Then, you can either start the container with [docker compose](https://docs.docker.com/compose/) (preferred):
67+
68+
```yml
69+
services:
70+
proxy:
71+
image: ghcr.io/1rgs/claude-code-proxy:latest
72+
restart: unless-stopped
73+
env_file: .env
74+
ports:
75+
- 8082:8082
76+
```
77+
78+
Or with a command:
79+
80+
```bash
81+
docker run -d --env-file .env -p 8082:8082 ghcr.io/1rgs/claude-code-proxy:latest
82+
```
83+
5784
### Using with Claude Code 🎮
5885

5986
1. **Install Claude Code** (if you haven't already):
@@ -101,7 +128,7 @@ The following Gemini models are supported with automatic `gemini/` prefix handli
101128

102129
### Model Prefix Handling
103130
The proxy automatically adds the appropriate prefix to model names:
104-
- OpenAI models get the `openai/` prefix
131+
- OpenAI models get the `openai/` prefix
105132
- Gemini models get the `gemini/` prefix
106133
- The BIG_MODEL and SMALL_MODEL will get the appropriate prefix based on whether they're in the OpenAI or Gemini model lists
107134

0 commit comments

Comments
 (0)