Dockerfile 584 B

1234567891011121314151617181920212223242526
  1. FROM python:3.12-slim
  2. WORKDIR /app
  3. RUN apt-get update && apt-get install -y --no-install-recommends \
  4. build-essential \
  5. curl \
  6. libpq-dev \
  7. && rm -rf /var/lib/apt/lists/*
  8. COPY pyproject.toml uv.lock ./
  9. # 配置 pip 和 uv 使用阿里云镜像,使用系统 Python
  10. ENV PIP_INDEX_URL=https://mirrors.aliyun.com/pypi/simple/
  11. ENV UV_INDEX_URL=https://mirrors.aliyun.com/pypi/simple/
  12. ENV UV_PYTHON_PREFERENCE=system
  13. RUN pip install --no-cache-dir uv && \
  14. uv sync --frozen --no-dev
  15. COPY . .
  16. RUN chmod +x entrypoint.sh
  17. ENTRYPOINT ["./entrypoint.sh"]
  18. EXPOSE 5000