Download Dockerfile from azils3/Professor: direct link, hf CLI and curl.
- Browser
- Download file 882 Bytes
-
https://huggingface.co/spaces/azils3/Professor/resolve/main/Dockerfile
- Command line
-
hf download hf://spaces/azils3/Professor/Dockerfile
-
curl -L -o Dockerfile https://huggingface.co/spaces/azils3/Professor/resolve/main/Dockerfile
882 Bytes
| # Dockerfile | |
| FROM python:3.10 | |
| # Create a non-root user with valid username format | |
| RUN adduser --disabled-password --gecos '' professor && \ | |
| mkdir -p /app && \ | |
| chown -R professor:professor /app | |
| # Install system dependencies | |
| RUN apt-get update && apt-get upgrade -y | |
| # Copy requirements and install | |
| COPY requirements.txt /requirements.txt | |
| RUN pip install --upgrade pip && \ | |
| pip install -r /requirements.txt | |
| # Switch to non-root user | |
| USER professor | |
| WORKDIR /app | |
| # Copy application files | |
| COPY --chown=professor:professor . . | |
| # Set environment variables | |
| ENV LOG_PATH=/app/BotLog.txt | |
| ENV FLASK_APP=app.py | |
| ENV FLASK_DEBUG=0 | |
| ENV FLASK_RUN_HOST=0.0.0.0 | |
| ENV FLASK_RUN_PORT=7860 | |
| # Ensure the log file is writable | |
| RUN touch $LOG_PATH && chmod 666 $LOG_PATH | |
| # Expose port | |
| EXPOSE 7860 | |
| # Start Pyrogram bot and Flask app separately | |
| CMD ["sh", "-c", "python bot.py & flask run"] |