Spaces:
Sleeping
Sleeping
| # Use a base image that includes both Python and R. rocker/r-ver is a popular choice for R, with an R base and Python installed. | |
| FROM rocker/r-ver:4.1.0 | |
| # Install Python, pip, and system dependencies for your Python packages, e.g., for matplotlib. | |
| # Dependencies being installed: | |
| # - libfreetype6-dev, libxft-dev for matplotlib | |
| # - libpcre2-dev for -lpcre2-8, liblzma-dev for -llzma, libbz2-dev for -lbz2, libicu-dev for -licuuc and -licui18n for rpy2 compilation requirements | |
| RUN apt-get update && apt-get install -y \ | |
| python3-pip \ | |
| python3-dev \ | |
| libfreetype6-dev \ | |
| libxft-dev \ | |
| libpcre2-dev \ | |
| liblzma-dev \ | |
| libbz2-dev \ | |
| libicu-dev \ | |
| && rm -rf /var/lib/apt/lists/* | |
| # Copy the requirements.txt file, your app script, and the R script into the container. | |
| COPY requirements.txt /requirements.txt | |
| COPY app.py /app.py | |
| COPY data_source /data_source | |
| # Install Python dependencies from requirements.txt. | |
| RUN pip3 install --no-cache-dir -r /requirements.txt | |
| # Expose the port Gradio runs on. | |
| EXPOSE 7860 | |
| # Command to run your app. | |
| CMD ["python3", "/app.py"] | |