anithai commited on
Commit
5e8068c
·
verified ·
1 Parent(s): 9a47eac

Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +13 -12
Dockerfile CHANGED
@@ -1,18 +1,19 @@
1
- FROM python:3.10-slim
2
 
3
- # Install Java (correct path fix)
4
- RUN apt-get update && apt-get install -y default-jre
5
-
6
- # Install Gradio
7
- RUN pip install gradio
8
 
9
- # Copy project files
10
  COPY . /app
11
- WORKDIR /app
12
 
13
- # Compile Java Code
14
- RUN javac -cp ".:/app/json-20210307.jar" Main.java
 
 
 
 
 
 
 
15
 
16
- # Run Gradio app
17
- CMD ["python3", "app.py"]
18
 
 
1
+ FROM openjdk:17-jdk-slim
2
 
3
+ # Set the working directory
4
+ WORKDIR /app
 
 
 
5
 
6
+ # Copy all project files
7
  COPY . /app
 
8
 
9
+ # Create a 'lib' folder and copy the JSON jar file
10
+ RUN mkdir -p /app/lib
11
+ COPY lib/json-20210307.jar /app/lib/
12
+
13
+ # Install required Python dependencies
14
+ RUN pip install gradio
15
+
16
+ # Run Java with classpath including the JAR file
17
+ CMD ["java", "-cp", "/app/lib/json-20210307.jar:/app", "Main"]
18
 
 
 
19