Files
DDUp/Dockerfile
2026-01-22 12:57:26 +08:00

33 lines
648 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.11-slim
# 设置工作目录
WORKDIR /app
# 安装依赖(用于 weasyprint
RUN apt-get update && apt-get install -y \
libpango-1.0-0 \
libpangocairo-1.0-0 \
libgdk-pixbuf2.0-0 \
libffi-dev \
shared-mime-info \
&& rm -rf /var/lib/apt/lists/*
# 复制项目文件
COPY pyproject.toml .
COPY src/ src/
# 安装 Python 依赖
RUN pip install --no-cache-dir -e .
# 创建数据目录
RUN mkdir -p /app/data
# 暴露端口
EXPOSE 8080
# 设置环境变量
ENV VITALS_DB_PATH=/app/data/vitals.db
# 启动命令
CMD ["python", "-m", "uvicorn", "vitals.web.app:app", "--host", "0.0.0.0", "--port", "8080"]