Spaces:
Running
Running
File size: 1,335 Bytes
49eef15 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 | # 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/*
# Install R packages
RUN R -e "install.packages(c('relaimpo', 'readxl', 'readr', 'lavaan', 'leaps', 'dplyr', 'tidyr'), repos='http://cran.rstudio.com/')"
# 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 process_data.R /process_data.R
COPY example_files /example_files
COPY images /images
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"]
|