ICTuniverse commited on
Commit
6fda511
·
verified ·
1 Parent(s): 47ce178

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +15 -16
Dockerfile CHANGED
@@ -1,25 +1,24 @@
1
- # Use an official Python runtime as the base image
2
- FROM python:3.9-slim
3
 
4
- # Set working directory
5
- WORKDIR /app
 
 
 
 
6
 
7
- # Install system dependencies (e.g., Java for vncorenlp)
8
- RUN apt-get update && apt-get install -y \
9
- openjdk-11-jre \
10
- && rm -rf /var/lib/apt/lists/*
11
 
12
- # Copy requirements file
13
- COPY requirements.txt .
14
 
15
  # Install Python dependencies
16
  RUN pip install --no-cache-dir -r requirements.txt
17
 
18
- # Copy the rest of the application files
19
- COPY . .
20
-
21
- # Expose the port the app runs on (Hugging Face Spaces default is 7860)
22
  EXPOSE 7860
23
 
24
-
25
- CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
 
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
24
+ CMD ["python", "app.py"]