Spaces:
Paused
Paused
| # Use the official Python 3.9 image as the base | |
| FROM python:3.9 | |
| # Create a new user to avoid running as root | |
| RUN useradd -m -u 1000 user | |
| USER user | |
| # Add local binary path to the environment PATH | |
| ENV PATH="/home/user/.local/bin:$PATH" | |
| # Set the working directory in the container | |
| WORKDIR /app | |
| # Copy and install Python dependencies | |
| COPY --chown=user ./requirements.txt requirements.txt | |
| RUN pip install --no-cache-dir --upgrade -r requirements.txt | |
| # Copy the bot code into the container | |
| COPY --chown=user . /app | |
| # Specify the default command to run the bot | |
| CMD ["python", "bot.py"] | |