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

# 1. HARDCODE THE INSTALLATION (Bypasses requirements.txt completely)
RUN pip install --no-cache-dir streamlit pandas bertopic sentence-transformers scikit-learn umap-learn hdbscan gensim matplotlib seaborn

# 2. Create the Hugging Face restricted user
RUN useradd -m -u 1000 user
USER user

# 3. Set the environment variables safely
ENV HOME=/home/user
ENV PATH=/usr/local/bin:/home/user/.local/bin:$PATH

# 4. Set the working directory
WORKDIR $HOME/app

# 5. Copy your python code and images into the container
COPY --chown=user:user . $HOME/app

# 6. Launch explicitly through Python to bypass the Linux PATH entirely
CMD ["python", "-m", "streamlit", "run", "app.py", "--server.port", "7860", "--server.address", "0.0.0.0"]