| # Use official Python image | |
| FROM python:3.10-slim | |
| # Prevent Python from buffering output | |
| ENV PYTHONUNBUFFERED=1 | |
| # Set working directory | |
| WORKDIR /app | |
| # Install system dependencies | |
| RUN apt-get update && apt-get install -y \ | |
| git \ | |
| build-essential \ | |
| && rm -rf /var/lib/apt/lists/* | |
| # Install nano | |
| RUN apt-get update && apt-get install -y nano | |
| # Copy requirements.txt | |
| COPY requirements.txt /app | |
| # Install Potato and Python dependencies | |
| RUN pip install --upgrade pip | |
| RUN pip install --no-cache-dir -r /app/requirements.txt | |
| # Copy files and set access rights | |
| COPY --chown=user . /app | |
| RUN chmod +x /app/start.sh | |
| # Expose web port | |
| EXPOSE 7860 | |
| # Run start script | |
| CMD ["/app/start.sh"] |