Skip to content

Commit

Permalink
update README
Browse files Browse the repository at this point in the history
  • Loading branch information
yym68686 committed Jul 8, 2024
1 parent e09244d commit 53eb9f9
Show file tree
Hide file tree
Showing 3 changed files with 62 additions and 0 deletions.
10 changes: 10 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
FROM python:3.10.13 AS builder
COPY ./requirements.txt /home
RUN pip install -r /home/requirements.txt

FROM python:3.10.13-slim-bullseye
EXPOSE 8000
WORKDIR /home
COPY --from=builder /usr/local/lib/python3.10/site-packages /usr/local/lib/python3.10/site-packages
COPY . /home
ENTRYPOINT ["python", "-u", "/home/main.py"]
41 changes: 41 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,45 @@ curl -X POST http://127.0.0.1:8000/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer sk-KjjI60Yf0JFcsvgRmXqFwgGmWUd9GZnmi3KlvowmRWpWpQRo" \
-d '{"model": "gpt-4o","messages": [{"role": "user", "content": "Hello"}],"stream": true}'
```

## Docker Local Deployment

Start the container

```bash
docker run -p 8001:8000 --name uni-api -dit \
-v ./api.yaml:/home/api.yaml \
-e USE_ROUND_ROBIN=True \
yym68686/uni-api:latest
```

Or if you want to use Docker Compose, here is a docker-compose.yml example:

```yaml
version: "3.5"
services:
uni-api:
container_name: uni-api
image: yym68686/uni-api:latest
environment:
- USE_ROUND_ROBIN=True
ports:
- 8001:8000
volumes:
- ./api.yaml:/home/api.yaml
```
Run Docker Compose container in the background
```bash
docker-compose up -d
```

Docker build

```bash
docker build --no-cache -t uni-api:latest -f Dockerfile --platform linux/amd64 .
docker tag uni-api:latest yym68686/uni-api:latest
docker push yym68686/uni-api:latest
```
11 changes: 11 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
version: "3.5"
services:
uni-api:
container_name: uni-api
image: yym68686/uni-api:latest
environment:
- USE_ROUND_ROBIN=True
ports:
- 8001:8000
volumes:
- ./api.yaml:/home/api.yaml

0 comments on commit 53eb9f9

Please sign in to comment.