yym68686 commited on
Commit
53eb9f9
·
1 Parent(s): e09244d

update README

Browse files
Files changed (3) hide show
  1. Dockerfile +10 -0
  2. README.md +41 -0
  3. docker-compose.yml +11 -0
Dockerfile ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM python:3.10.13 AS builder
2
+ COPY ./requirements.txt /home
3
+ RUN pip install -r /home/requirements.txt
4
+
5
+ FROM python:3.10.13-slim-bullseye
6
+ EXPOSE 8000
7
+ WORKDIR /home
8
+ COPY --from=builder /usr/local/lib/python3.10/site-packages /usr/local/lib/python3.10/site-packages
9
+ COPY . /home
10
+ ENTRYPOINT ["python", "-u", "/home/main.py"]
README.md CHANGED
@@ -5,4 +5,45 @@ curl -X POST http://127.0.0.1:8000/v1/chat/completions \
5
  -H "Content-Type: application/json" \
6
  -H "Authorization: Bearer sk-KjjI60Yf0JFcsvgRmXqFwgGmWUd9GZnmi3KlvowmRWpWpQRo" \
7
  -d '{"model": "gpt-4o","messages": [{"role": "user", "content": "Hello"}],"stream": true}'
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
8
  ```
 
5
  -H "Content-Type: application/json" \
6
  -H "Authorization: Bearer sk-KjjI60Yf0JFcsvgRmXqFwgGmWUd9GZnmi3KlvowmRWpWpQRo" \
7
  -d '{"model": "gpt-4o","messages": [{"role": "user", "content": "Hello"}],"stream": true}'
8
+ ```
9
+
10
+ ## Docker Local Deployment
11
+
12
+ Start the container
13
+
14
+ ```bash
15
+ docker run -p 8001:8000 --name uni-api -dit \
16
+ -v ./api.yaml:/home/api.yaml \
17
+ -e USE_ROUND_ROBIN=True \
18
+ yym68686/uni-api:latest
19
+ ```
20
+
21
+ Or if you want to use Docker Compose, here is a docker-compose.yml example:
22
+
23
+ ```yaml
24
+ version: "3.5"
25
+ services:
26
+ uni-api:
27
+ container_name: uni-api
28
+ image: yym68686/uni-api:latest
29
+ environment:
30
+ - USE_ROUND_ROBIN=True
31
+ ports:
32
+ - 8001:8000
33
+ volumes:
34
+ - ./api.yaml:/home/api.yaml
35
+ ```
36
+
37
+ Run Docker Compose container in the background
38
+
39
+ ```bash
40
+ docker-compose up -d
41
+ ```
42
+
43
+ Docker build
44
+
45
+ ```bash
46
+ docker build --no-cache -t uni-api:latest -f Dockerfile --platform linux/amd64 .
47
+ docker tag uni-api:latest yym68686/uni-api:latest
48
+ docker push yym68686/uni-api:latest
49
  ```
docker-compose.yml ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ version: "3.5"
2
+ services:
3
+ uni-api:
4
+ container_name: uni-api
5
+ image: yym68686/uni-api:latest
6
+ environment:
7
+ - USE_ROUND_ROBIN=True
8
+ ports:
9
+ - 8001:8000
10
+ volumes:
11
+ - ./api.yaml:/home/api.yaml