安装运行

This commit is contained in:
2024-11-04 06:06:15 +08:00
parent ee88acf9a8
commit 543998b673
3 changed files with 11 additions and 57 deletions

View File

@@ -1,22 +1,19 @@
#!/bin/sh
# 安装依赖(使用清华镜像)
pip install -r requirements.txt -i https://pypi.tuna.tsinghua.edu.cn/simple
# 启动服务
cd ~/reverse_image_search_gpu
pm2 start python3 --name reverse_image_search_gpu -- main.py 5002
# pip freeze > requirements.txt
#pip install -r requirements.txt -i https://pypi.tuna.tsinghua.edu.cn/simple
#python3 -m pip install -U pyOpenSSL cryptography
#python main.py >/dev/null 2>&1 &
# 使用 uvicorn 启动两个工作进程, 并支持自动重载
#uvicorn main:app --host 0.0.0.0 --port 5001 --workers 2 --reload >/dev/null 2>&1 &
#uvicorn main:app --host 0.0.0.0 --port 5002 >/dev/null 2>&1 &
python main.py >/dev/null 2>&1 &
# 为容器设定自动重启
#docker update --restart=always 51bb94aa2726
#cd ~/reverse_image_search
#pm2 start python3 --name reverse-1 -- main.py 5001
#pm2 start python3 --name reverse-2 -- main.py 5002
#pm2 start python3 --name reverse-3 -- main.py 5003
# 某些系统下,需要手动安装指定版本 opencv-python (4.7引用zlib错误)
# pip install opencv-python==4.6.0.66 -i https://pypi.tuna.tsinghua.edu.cn/simple