feat:提交dockerfile

This commit is contained in:
雷雨
2025-06-06 10:14:29 +08:00
parent d8f127aeb4
commit eb7c4cf221
5 changed files with 20 additions and 6 deletions

4
.env
View File

@@ -5,6 +5,6 @@ MODEL_BASE_URL=https://api.deepseek.com
#模型名称
MODEL_NAME=deepseek-chat
#放行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模式
DJANGO_DEBUG_ENABLE=False
DJANGO_DEBUG_ENABLE=True

10
Dockerfile Normal file
View 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"]

View File

@@ -1,3 +1,4 @@
Django==5.2.1
requests==2.32.3
python-decouple==3.8
python-decouple==3.8
gunicorn==23.0.0

View File

@@ -11,8 +11,12 @@ BASE_URL = config('MODEL_BASE_URL', default="")
def parse_time(time_str: str) -> int:
timestamp = datetime.strptime(time_str, "%Y-%m-%d %H:%M:%S").timestamp()
return int(timestamp)
try:
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):
@@ -46,7 +50,6 @@ def query_room_info(params) -> str:
return str(result)
def book_room(data: dict, params: dict) -> str:
# resp = requests.post('http://127.0.0.1:8000/myapi/room/', data)
"""

Binary file not shown.