sms_server/Dockerfile
2025-03-22 22:52:04 +08:00

24 lines
583 B
Docker
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

FROM python:3.9-slim
WORKDIR /app
# 安装 git 用于拉取最新代码
RUN apt-get update && apt-get install -y git && apt-get clean
# 拉取最新代码请确保仓库为public否则需要处理身份验证
RUN git clone https://github.com/nmhjklnm/sms_server.git .
# 安装依赖
RUN pip install --no-cache-dir -r requirements.txt
# 创建数据目录
RUN mkdir -p /app/data
# 确保数据目录有正确的权限
RUN chmod -R 755 /app/data
# 暴露应用端口
EXPOSE 8322
# 运行应用
CMD ["uvicorn", "backend.main:app", "--host", "0.0.0.0", "--port", "8322"]