ICTuniverse commited on
Commit
5630e49
·
verified ·
1 Parent(s): 6fda511

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +11 -5
Dockerfile CHANGED
@@ -1,23 +1,29 @@
1
- # Use the official Python 3.10 image as a base
2
  FROM python:3.10-slim
3
 
4
  # Install OpenJDK 11 (includes javac)
5
- RUN apt-get update && apt-get install -y openjdk-11-jdk && apt-get clean
 
 
 
6
 
7
- # Set JAVA_HOME environment variable
8
  ENV JAVA_HOME=/usr/lib/jvm/java-11-openjdk-amd64
9
  ENV PATH=$JAVA_HOME/bin:$PATH
10
 
 
 
 
11
  # Set working directory
12
  WORKDIR /home/user/app
13
 
14
- # Copy your app files
15
  COPY . .
16
 
17
  # Install Python dependencies
18
  RUN pip install --no-cache-dir -r requirements.txt
19
 
20
- # Expose the port HF Spaces uses
21
  EXPOSE 7860
22
 
23
  # Run the Flask app
 
1
+ # Use Python 3.10 slim as base image
2
  FROM python:3.10-slim
3
 
4
  # Install OpenJDK 11 (includes javac)
5
+ RUN apt-get update && \
6
+ apt-get install -y openjdk-11-jdk && \
7
+ apt-get clean && \
8
+ rm -rf /var/lib/apt/lists/*
9
 
10
+ # Set JAVA_HOME and update PATH
11
  ENV JAVA_HOME=/usr/lib/jvm/java-11-openjdk-amd64
12
  ENV PATH=$JAVA_HOME/bin:$PATH
13
 
14
+ # Verify Java installation
15
+ RUN java -version && javac -version
16
+
17
  # Set working directory
18
  WORKDIR /home/user/app
19
 
20
+ # Copy application files
21
  COPY . .
22
 
23
  # Install Python dependencies
24
  RUN pip install --no-cache-dir -r requirements.txt
25
 
26
+ # Expose port for HF Spaces
27
  EXPOSE 7860
28
 
29
  # Run the Flask app