FROM python:3.9-slim RUN useradd -m -u 1000 user ENV HOME=/home/user \ PATH=/home/user/.local/bin:$PATH \ PORT=7860 \ HOST=0.0.0.0 WORKDIR $HOME/app RUN apt-get update && apt-get install -y --no-install-recommends \ gcc \ && rm -rf /var/lib/apt/lists/* RUN pip install --no-cache-dir --upgrade pip COPY requirements.txt . RUN pip install --no-cache-dir -r requirements.txt COPY --chown=user . $HOME/app USER user EXPOSE 7860 CMD ["python", "app.py"] ``` ### 📁 **4. Create directory: templates/** Create a folder called `templates` in the same directory as your other files.