19 lines
425 B
Docker
19 lines
425 B
Docker
FROM python:3.13-slim
|
|
|
|
# 设置东八区时区
|
|
ENV TZ=Asia/Shanghai
|
|
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
|
|
|
|
WORKDIR /app
|
|
|
|
COPY requirements.txt .
|
|
RUN pip install --no-cache-dir -r requirements.txt
|
|
|
|
COPY . .
|
|
|
|
# 数据库文件存放在 /app/data 目录,通过 volume 持久化
|
|
RUN mkdir -p /app/data
|
|
|
|
EXPOSE 8000
|
|
|
|
CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "8000"] |