File size: 602 Bytes
0b5e1b0
fa8cc7d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
0b5e1b0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
FROM python:3.10

# 1. Create the specific user required by Hugging Face Spaces
RUN useradd -m -u 1000 user
USER user
ENV PATH="/home/user/.local/bin:$PATH"
ENV HOME="/home/user"

# 2. Set the working directory to that user's safe space
WORKDIR $HOME/app

# 3. Copy requirements and install them
COPY --chown=user:user requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt

# 4. Copy your app.py and images into the safe space
COPY --chown=user:user . .

# 5. Launch Streamlit
CMD ["streamlit", "run", "app.py", "--server.port", "7860", "--server.address", "0.0.0.0"]