File size: 658 Bytes
1d10b0a
 
 
 
067eae3
1d10b0a
 
7406588
 
3c053b7
7406588
 
 
 
 
 
 
1d10b0a
 
7406588
1d10b0a
 
067eae3
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
FROM python:3.10-slim

RUN useradd -m -u 1000 user
USER user
ENV HOME=/home/user PATH=/home/user/.local/bin:$PATH
WORKDIR $HOME/app

# Copy requirements and install dependencies
COPY --chown=user requirements.txt .

# Install torch CPU first, then other requirements
RUN pip install --no-cache-dir --upgrade pip && \
    pip install --no-cache-dir torch --index-url https://download.pytorch.org/whl/cpu && \
    pip install --no-cache-dir -r requirements.txt

# Copy all application files
COPY --chown=user . .

ENV PYTHONUNBUFFERED=1
ENV SPACE_ID=1
EXPOSE 7860

CMD ["streamlit", "run", "streamlit_app.py", "--server.port=7860", "--server.address=0.0.0.0"]