Download Dockerfile from gtech13/Topic-Modeling-BERTopic-Math-Visualization: direct link, hf CLI and curl.
- Browser
- Download file 820 Bytes
-
https://huggingface.co/spaces/gtech13/Topic-Modeling-BERTopic-Math-Visualization/resolve/946ab5d44e9b3347d9108793d502d6039401d609/Dockerfile
- Command line
-
hf download hf://spaces/gtech13/Topic-Modeling-BERTopic-Math-Visualization@946ab5d44e9b3347d9108793d502d6039401d609/Dockerfile
-
curl -L -o Dockerfile https://huggingface.co/spaces/gtech13/Topic-Modeling-BERTopic-Math-Visualization/resolve/946ab5d44e9b3347d9108793d502d6039401d609/Dockerfile
820 Bytes
| FROM python:3.10 | |
| # 1. Set a temporary working directory | |
| WORKDIR /code | |
| # 2. Copy just the requirements first and install them GLOBALLY | |
| COPY ./requirements.txt /code/requirements.txt | |
| RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt | |
| # 3. Create the restricted user required by Hugging Face Spaces | |
| RUN useradd -m -u 1000 user | |
| # 4. Switch to that user | |
| USER user | |
| # 5. Set up the user's safe environment variables | |
| ENV HOME=/home/user | |
| ENV PATH=/home/user/.local/bin:$PATH | |
| # 6. Set the working directory to the user's safe space | |
| WORKDIR $HOME/app | |
| # 7. Copy your app.py and images into the container, owned by the safe user | |
| COPY --chown=user:user . $HOME/app | |
| # 8. Launch Streamlit safely | |
| CMD ["streamlit", "run", "app.py", "--server.port", "7860", "--server.address", "0.0.0.0"] |