Spaces:
Sleeping
Sleeping
Download Dockerfile from Tech14-TutoR/TutoR: direct link, hf CLI and curl.
- Browser
- Download file 1.37 kB
-
https://huggingface.co/spaces/Tech14-TutoR/TutoR/resolve/main/Dockerfile
- Command line
-
hf download hf://spaces/Tech14-TutoR/TutoR/Dockerfile
-
curl -L -o Dockerfile https://huggingface.co/spaces/Tech14-TutoR/TutoR/resolve/main/Dockerfile
1.37 kB
| FROM rocker/shiny-verse:latest | |
| # Install system dependencies including Python | |
| RUN apt-get update && apt-get install -y \ | |
| python3-full \ | |
| python3-pip \ | |
| python3-venv \ | |
| && rm -rf /var/lib/apt/lists/* | |
| WORKDIR /code | |
| # Install R packages | |
| RUN install2.r --error \ | |
| ggExtra \ | |
| httr \ | |
| jsonlite \ | |
| commonmark \ | |
| glue \ | |
| reticulate | |
| # Create and activate virtual environment | |
| ENV VIRTUAL_ENV=/opt/venv | |
| RUN python3 -m venv $VIRTUAL_ENV | |
| ENV PATH="$VIRTUAL_ENV/bin:$PATH" | |
| # Install Python packages in the virtual environment | |
| RUN pip install --no-cache-dir \ | |
| torch \ | |
| sentence-transformers \ | |
| pandas \ | |
| numpy | |
| # Create directories for model cache and make them writable | |
| RUN mkdir -p /.cache/torch/sentence_transformers \ | |
| && chmod -R 777 /.cache | |
| # Create additional writable directories that sentence-transformers might need | |
| RUN mkdir -p /.cache/huggingface \ | |
| && chmod -R 777 /.cache/huggingface | |
| # Copy your application files | |
| COPY . . | |
| # Make the application directory writable for runtime installations | |
| RUN chmod -R 777 /code | |
| # Enable installation of R packages | |
| RUN chmod -R 777 /usr/local/lib/R/site-library | |
| # Configure R to use the virtual environment's Python | |
| RUN echo "RETICULATE_PYTHON='$VIRTUAL_ENV/bin/python'" >> /usr/local/lib/R/etc/Renviron | |
| CMD ["R", "--quiet", "-e", "shiny::runApp(host='0.0.0.0', port=7860)"] |