File size: 1,088 Bytes
f5b0da4
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
e89d36a
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
# 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"]