Ifeanyi commited on
Commit
159ba36
·
verified ·
1 Parent(s): 3dfcd28

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +13 -19
Dockerfile CHANGED
@@ -1,34 +1,28 @@
1
- # Use the official Python 3.10 base image
2
  FROM python:3.10-slim
3
 
4
- # Set environment variables
5
- ENV R_HOME=/usr/lib/R
6
- ENV PATH="${R_HOME}/bin:${PATH}"
7
-
8
- # Set the working directory in the container
9
- WORKDIR /app
10
-
11
- # Install system dependencies and R
12
  RUN apt-get update && \
13
  apt-get install -y --no-install-recommends \
14
  r-base \
15
- libcurl4-openssl-dev \
16
- libssl-dev \
17
  libxml2-dev \
18
- libgit2-dev && \
 
19
  rm -rf /var/lib/apt/lists/*
20
 
21
- # Copy the requirements file into the container
22
- COPY requirements.txt .
23
 
24
  # Install Python dependencies
25
- RUN pip install --no-cache-dir -r requirements.txt
 
26
 
27
- # Copy the rest of the application code into the container
28
- COPY . .
29
 
30
- # Expose the port that Gradio will run on
31
- EXPOSE 7860
32
 
33
  # Command to run the application
34
  CMD ["python", "app.py"]
 
1
+ # Use the official Python image as a base
2
  FROM python:3.10-slim
3
 
4
+ # Install R and necessary dependencies
 
 
 
 
 
 
 
5
  RUN apt-get update && \
6
  apt-get install -y --no-install-recommends \
7
  r-base \
8
+ r-base-dev \
 
9
  libxml2-dev \
10
+ libssl-dev \
11
+ libcurl4-openssl-dev && \
12
  rm -rf /var/lib/apt/lists/*
13
 
14
+ # Set R_HOME environment variable
15
+ ENV R_HOME=/usr/lib/R
16
 
17
  # Install Python dependencies
18
+ COPY requirements.txt /tmp/requirements.txt
19
+ RUN pip install --no-cache-dir -r /tmp/requirements.txt
20
 
21
+ # Set the working directory
22
+ WORKDIR /app
23
 
24
+ # Copy the application code
25
+ COPY . /app
26
 
27
  # Command to run the application
28
  CMD ["python", "app.py"]