Dockerfile 682 B

12345678910111213141516171819202122232425
  1. FROM python:3.11-slim
  2. WORKDIR /app
  3. ENV PYTHONDONTWRITEBYTECODE=1
  4. ENV PYTHONUNBUFFERED=1
  5. ENV PIP_DISABLE_PIP_VERSION_CHECK=on
  6. ENV NVM_DIR=/root/.nvm
  7. # 安装 Node.js(推荐安装官方 LTS 版本)并安装 jsdom
  8. RUN apt-get update && apt-get install -y curl gnupg ca-certificates \
  9. && curl -fsSL https://deb.nodesource.com/setup_20.x | bash - \
  10. && apt-get install -y nodejs \
  11. && npm install jsdom \
  12. && apt-get clean \
  13. && rm -rf /var/lib/apt/lists/*
  14. COPY requirements.txt .
  15. RUN pip install --no-cache-dir -r requirements.txt -i https://mirrors.aliyun.com/pypi/simple
  16. COPY . .
  17. EXPOSE 6060
  18. CMD ["hypercorn", "task_app:app", "--config", "app_config.toml"]