File size: 637 Bytes
cbfb0e7
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
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.