feat:提交dockerfile
This commit is contained in:
4
.env
4
.env
@@ -5,6 +5,6 @@ MODEL_BASE_URL=https://api.deepseek.com
|
|||||||
#模型名称
|
#模型名称
|
||||||
MODEL_NAME=deepseek-chat
|
MODEL_NAME=deepseek-chat
|
||||||
#放行host地址
|
#放行host地址
|
||||||
DJANGO_ALLOWED_HOSTS=192.168.237.130,127.0.0.1,10.212.27.4
|
DJANGO_ALLOWED_HOSTS=192.168.237.130,127.0.0.1,10.212.26.136
|
||||||
#是否开启debug模式
|
#是否开启debug模式
|
||||||
DJANGO_DEBUG_ENABLE=False
|
DJANGO_DEBUG_ENABLE=True
|
||||||
10
Dockerfile
Normal file
10
Dockerfile
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
FROM docker-0.unsee.tech/python:3.12-slim
|
||||||
|
WORKDIR /app
|
||||||
|
COPY . /app
|
||||||
|
ENV TZ=Asia/Shanghai \
|
||||||
|
LANG=C.UTF-8
|
||||||
|
RUN apt-get update && pip install -r requirements.txt -i https://mirrors.aliyun.com/pypi/simple/ \
|
||||||
|
&& pip install yonyouopenapisdk-1.1.1-py3-none-any.whl -i https://mirrors.aliyun.com/pypi/simple/
|
||||||
|
RUN mkdir -p /app/logs && touch /app/logs/yj_room_agent.log
|
||||||
|
EXPOSE 9000
|
||||||
|
CMD ["gunicorn","-w 3","-b 0.0.0.0:9000", "yj_room_agent.wsgi"]
|
||||||
@@ -1,3 +1,4 @@
|
|||||||
Django==5.2.1
|
Django==5.2.1
|
||||||
requests==2.32.3
|
requests==2.32.3
|
||||||
python-decouple==3.8
|
python-decouple==3.8
|
||||||
|
gunicorn==23.0.0
|
||||||
@@ -11,8 +11,12 @@ BASE_URL = config('MODEL_BASE_URL', default="")
|
|||||||
|
|
||||||
|
|
||||||
def parse_time(time_str: str) -> int:
|
def parse_time(time_str: str) -> int:
|
||||||
timestamp = datetime.strptime(time_str, "%Y-%m-%d %H:%M:%S").timestamp()
|
try:
|
||||||
return int(timestamp)
|
timestamp = datetime.strptime(time_str, "%Y-%m-%d %H:%M:%S").timestamp()
|
||||||
|
return int(timestamp)
|
||||||
|
except Exception as ee:
|
||||||
|
print("解析时间错误:" + str(ee.with_traceback()))
|
||||||
|
return int(datetime.now().timestamp())
|
||||||
|
|
||||||
|
|
||||||
def is_json(myjson):
|
def is_json(myjson):
|
||||||
@@ -46,7 +50,6 @@ def query_room_info(params) -> str:
|
|||||||
return str(result)
|
return str(result)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def book_room(data: dict, params: dict) -> str:
|
def book_room(data: dict, params: dict) -> str:
|
||||||
# resp = requests.post('http://127.0.0.1:8000/myapi/room/', data)
|
# resp = requests.post('http://127.0.0.1:8000/myapi/room/', data)
|
||||||
"""
|
"""
|
||||||
|
|||||||
BIN
yonyouopenapisdk-1.1.1-py3-none-any.whl
Normal file
BIN
yonyouopenapisdk-1.1.1-py3-none-any.whl
Normal file
Binary file not shown.
Reference in New Issue
Block a user