Download Dockerfile from Spanicin/tt3d: direct link, hf CLI and curl.
- Browser
- Download file 1.23 kB
-
https://huggingface.co/spaces/Spanicin/tt3d/resolve/main/Dockerfile
- Command line
-
hf download hf://spaces/Spanicin/tt3d/Dockerfile
-
curl -L -o Dockerfile https://huggingface.co/spaces/Spanicin/tt3d/resolve/main/Dockerfile
1.23 kB
| # Use the official Python image as a base | |
| FROM python:3.9.13 | |
| # Set environment variables | |
| ENV HOME=/home/user | |
| ENV PATH=$HOME/.local/bin:$PATH | |
| # Create a non-root user and set ownership for HOME directory | |
| RUN useradd -m -u 1000 user | |
| RUN chown -R user:user $HOME | |
| # Set the working directory | |
| WORKDIR $HOME/app | |
| # Clone the shap-e repository from GitHub (optional based on your needs) | |
| RUN git clone https://github.com/openai/shap-e . | |
| # Copy the local app files into the container | |
| COPY --chown=user . . | |
| # Create a requirements.txt file with specified dependencies | |
| RUN echo "-e ." > requirements.txt \ | |
| && echo "flask" >> requirements.txt \ | |
| && echo "flask_cors" >> requirements.txt \ | |
| && echo "PyYAML" >> requirements.txt \ | |
| && echo "ipywidgets" >> requirements.txt \ | |
| && echo "gunicorn" >> requirements.txt | |
| # Create a directory for model cache with appropriate permissions | |
| RUN mkdir -p $HOME/app/shap_e_model_cache | |
| RUN chown -R user:user $HOME/app/shap_e_model_cache | |
| # Install Python dependencies | |
| RUN pip install --no-cache-dir -r requirements.txt | |
| # Set Numba cache directory (optional) | |
| ENV NUMBA_CACHE_DIR=/tmp/numba_cache | |
| # Default command to run the application | |
| CMD ["gunicorn", "-b", "0.0.0.0:7860", "app:app"] | |