Skip to content

Commit c16938b

Browse files
committed
支持 docker
1 parent 97f1b1c commit c16938b

File tree

2 files changed

+29
-0
lines changed

2 files changed

+29
-0
lines changed

docker/Dockerfile

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
FROM ghcr.io/astral-sh/uv:python3.12-bookworm-slim
2+
3+
WORKDIR /app
4+
5+
# 设置 UV 镜像源为清华大学源以加速依赖安装
6+
ENV UV_INDEX_URL=https://pypi.tuna.tsinghua.edu.cn/simple
7+
8+
9+
RUN uv init && uv add openai-router -U
10+
11+
# 把 venv 的 bin 放进 PATH,后面可以直接用 openai-router
12+
ENV PATH="/app/.venv/bin:$PATH"
13+
14+
EXPOSE 8000
15+
16+
CMD ["/bin/bash"]

docker/docker-compose.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
version: "3.9"
2+
services:
3+
openai-router:
4+
build:
5+
context: .
6+
dockerfile: Dockerfile
7+
image: openai-router:latest
8+
container_name: openai-router
9+
ports:
10+
- "8000:8000"
11+
restart: unless-stopped
12+
command: openai-router --host 0.0.0.0
13+

0 commit comments

Comments
 (0)