Files
DDUp/Dockerfile
2026-01-22 14:06:20 +08:00

33 lines
660 B
Docker
Raw Permalink 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-pixbuf-2.0-0 \
libffi-dev \
shared-mime-info \
&& rm -rf /var/lib/apt/lists/*
# 复制项目文件
COPY pyproject.toml README.md ./
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"]