Update Dockerfile
Browse files- Dockerfile +15 -4
Dockerfile
CHANGED
@@ -1,7 +1,13 @@
|
|
1 |
-
FROM
|
2 |
|
3 |
-
#
|
|
|
|
|
|
|
4 |
RUN apt-get update && \
|
|
|
|
|
|
|
5 |
apt-get install -y openjdk-11-jdk curl && \
|
6 |
rm -rf /var/lib/apt/lists/*
|
7 |
|
@@ -9,12 +15,17 @@ RUN apt-get update && \
|
|
9 |
ENV JAVA_HOME /usr/lib/jvm/java-11-openjdk-amd64
|
10 |
ENV PATH $JAVA_HOME/bin:$PATH
|
11 |
|
|
|
|
|
|
|
|
|
|
|
12 |
# Set the working directory
|
13 |
WORKDIR /app
|
14 |
|
15 |
# Copy the requirements file and install Python dependencies
|
16 |
COPY requirements.txt .
|
17 |
-
RUN
|
18 |
|
19 |
# Copy the application code
|
20 |
COPY app.py .
|
@@ -23,7 +34,7 @@ COPY app.py .
|
|
23 |
EXPOSE 7860
|
24 |
|
25 |
# Command to run the application
|
26 |
-
CMD ["
|
27 |
|
28 |
|
29 |
|
|
|
1 |
+
FROM ubuntu:20.04
|
2 |
|
3 |
+
# Set environment variables to avoid interactive prompts during package installation
|
4 |
+
ENV DEBIAN_FRONTEND=noninteractive
|
5 |
+
|
6 |
+
# Install dependencies
|
7 |
RUN apt-get update && \
|
8 |
+
apt-get install -y software-properties-common && \
|
9 |
+
add-apt-repository ppa:openjdk-r/ppa && \
|
10 |
+
apt-get update && \
|
11 |
apt-get install -y openjdk-11-jdk curl && \
|
12 |
rm -rf /var/lib/apt/lists/*
|
13 |
|
|
|
15 |
ENV JAVA_HOME /usr/lib/jvm/java-11-openjdk-amd64
|
16 |
ENV PATH $JAVA_HOME/bin:$PATH
|
17 |
|
18 |
+
# Install Python
|
19 |
+
RUN apt-get update && \
|
20 |
+
apt-get install -y python3 python3-pip && \
|
21 |
+
rm -rf /var/lib/apt/lists/*
|
22 |
+
|
23 |
# Set the working directory
|
24 |
WORKDIR /app
|
25 |
|
26 |
# Copy the requirements file and install Python dependencies
|
27 |
COPY requirements.txt .
|
28 |
+
RUN pip3 install --no-cache-dir -r requirements.txt
|
29 |
|
30 |
# Copy the application code
|
31 |
COPY app.py .
|
|
|
34 |
EXPOSE 7860
|
35 |
|
36 |
# Command to run the application
|
37 |
+
CMD ["python3", "app.py"]
|
38 |
|
39 |
|
40 |
|