You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

18 lines
395 B

  1. FROM python:3.14-slim
  2. WORKDIR /app
  3. ENV PYTHONDONTWRITEBYTECODE=1
  4. ENV PYTHONUNBUFFERED=1
  5. # 如果不需要编译 C 扩展,可以跳过 gcc 安装
  6. # 只复制 requirements.txt 并安装 Python 依赖
  7. COPY requirements.txt .
  8. RUN pip install --no-cache-dir -r requirements.txt
  9. COPY ./app .
  10. RUN useradd -m -r appuser && chown -R appuser /app
  11. USER appuser
  12. EXPOSE 8000
  13. CMD ["python", "main.py"]