Download Dockerfile from gtech13/Topic-Modeling-BERTopic-Math-Visualization: direct link, hf CLI and curl.
- Browser
- Download file 840 Bytes
-
https://huggingface.co/spaces/gtech13/Topic-Modeling-BERTopic-Math-Visualization/resolve/bb3c200a7fcfd980452c1376c7ce1f07f65d22c1/Dockerfile
- Command line
-
hf download hf://spaces/gtech13/Topic-Modeling-BERTopic-Math-Visualization@bb3c200a7fcfd980452c1376c7ce1f07f65d22c1/Dockerfile
-
curl -L -o Dockerfile https://huggingface.co/spaces/gtech13/Topic-Modeling-BERTopic-Math-Visualization/resolve/bb3c200a7fcfd980452c1376c7ce1f07f65d22c1/Dockerfile
840 Bytes
| 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", "--server.enableCORS", "false", "--server.enableXsrfProtection", "false"] |