| FROM python:3.9-slim | |
| WORKDIR /app | |
| # Install git | |
| RUN apt-get update && apt-get install -y git && apt-get clean | |
| # Clone the repository | |
| RUN git clone https://github.com/aston314/Torrent-Api-py . | |
| # RUN git clone https://github.com/Ryuk-me/Torrent-Api-py . | |
| # Install dependencies | |
| RUN pip install --no-cache-dir -r requirements.txt | |
| # 对于 Flask 应用: | |
| # CMD ["python", "-c", "from app import app; app.run(host='0.0.0.0', port=7860)"] | |
| # Expose the port | |
| # EXPOSE 8009 | |
| EXPOSE 7860 | |
| # Environment variable for proxy (optional) | |
| ENV HTTP_PROXY="" | |
| # 设置健康检查 | |
| HEALTHCHECK --interval=30s --timeout=30s --start-period=5s --retries=3 \ | |
| CMD curl -f http://localhost:7860 || exit 1 | |
| # Command to run the application | |
| CMD ["python", "main.py"] |