forked from KenyonY/openai-forward
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
81 lines (61 loc) · 1.67 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
.PHONY: monitor start start-webui build push run down test twine log pull
image := "beidongjiedeguang/openai-forward:latest"
webui_image := "beidongjiedeguang/openai-forward:webui-latest"
container := "openai-forward-container"
compose_path := "docker-compose.yaml"
monitor:
@./scripts/ai-forward-monitor.sh
#stop-monitor:
# @pkill -f ai-forward-monitor.sh
# @pkill aifd
start:
@docker run -d \
--restart=unless-stopped \
--name $(container) \
--env-file .env \
-p 8000:8000 \
-v $(shell pwd)/Log:/home/openai-forward/Log \
-v $(shell pwd)/FLAXKV_DB:/home/openai-forward/FLAXDV_DB \
-v $(shell pwd)/openai_forward:/home/openai-forward/openai_forward \
$(image) --port=8000 --workers=1
@make log
start-webui:
@docker run -d \
--name $(container) \
--env-file .env \
-p 8000:8000 \
-p 8001:8001 \
-v $(shell pwd)/Log:/home/openai-forward/Log \
-v $(shell pwd)/FLAXKV_DB:/home/openai-forward/FLAXDV_DB \
-v $(shell pwd)/openai_forward:/home/openai-forward/openai_forward \
$(webui_image)
@make log
exec:
docker exec -it $(container) sh
log:
docker logs -f $(container)
rm:
docker rm -f $(container)
stop:
docker stop $(container)
up:
@docker-compose -f $(compose_path) up
down:
@docker-compose -f $(compose_path) down
run:
@docker-compose -f $(compose_path) run -it -p 8000:8000 openai_forward bash
test:
pytest -v tests
twine:
@twine upload dist/*
@rm -rf dist/*
build:
docker build --tag $(image) .
build-webui:
docker build --tag $(webui_image) . -f webui.Dockerfile
build-push:
docker buildx build --push --platform linux/arm64/v8,linux/amd64 --tag $(image) .
pull:
docker pull $(image)
deploy:
vercel --prod