Spaces:
Sleeping
Sleeping
Update Dockerfile
Browse files- Dockerfile +13 -19
Dockerfile
CHANGED
@@ -1,34 +1,28 @@
|
|
1 |
-
# Use the official Python
|
2 |
FROM python:3.10-slim
|
3 |
|
4 |
-
#
|
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 |
-
|
16 |
-
libssl-dev \
|
17 |
libxml2-dev \
|
18 |
-
|
|
|
19 |
rm -rf /var/lib/apt/lists/*
|
20 |
|
21 |
-
#
|
22 |
-
|
23 |
|
24 |
# Install Python dependencies
|
25 |
-
|
|
|
26 |
|
27 |
-
#
|
28 |
-
|
29 |
|
30 |
-
#
|
31 |
-
|
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"]
|