chaton2api1 / Dockerfile
smgc's picture
Update Dockerfile
890734a verified
raw
history blame contribute delete
412 Bytes
# 使用官方Python基础镜像
FROM python:3.9-slim
# 设置工作目录
WORKDIR /app
RUN mkdir -p /app/images && \
chmod -R 777 /app
# 复制当前目录下的所有文件到容器的/app目录
COPY . .
# 安装所需的Python库
RUN pip install --no-cache-dir fastapi uvicorn httpx pydantic requests
# 设置环境变量(可选)
ENV PYTHONUNBUFFERED=1
# 运行main.py
CMD ["python", "main.py"]