parthmax commited on
Commit
9a6d5fb
·
verified ·
1 Parent(s): dfc44d3

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +21 -4
Dockerfile CHANGED
@@ -1,9 +1,26 @@
1
- FROM python:3.10
 
2
 
3
- RUN apt-get update && apt-get install -y openjdk-17-jdk && apt-get clean
 
 
 
 
4
 
 
 
 
 
 
 
5
  WORKDIR /app
6
- COPY . .
7
- RUN pip install -r requirements.txt
 
 
 
 
 
8
 
 
9
  CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
 
1
+ # Base image: lightweight Python 3.10 (works well on Hugging Face)
2
+ FROM python:3.10-slim
3
 
4
+ # Install Java (OpenJDK 17 via default-jdk)
5
+ RUN apt-get update && \
6
+ apt-get install -y default-jdk curl && \
7
+ apt-get clean && \
8
+ rm -rf /var/lib/apt/lists/*
9
 
10
+ # Set environment variables
11
+ ENV JAVA_HOME=/usr/lib/jvm/java-17-openjdk-amd64
12
+ ENV PATH="$JAVA_HOME/bin:$PATH"
13
+
14
+ # Install Python dependencies
15
+ COPY requirements.txt /app/requirements.txt
16
  WORKDIR /app
17
+ RUN pip install --no-cache-dir -r requirements.txt
18
+
19
+ # Copy app files
20
+ COPY . /app
21
+
22
+ # Expose FastAPI port
23
+ EXPOSE 7860
24
 
25
+ # Run FastAPI with Uvicorn
26
  CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]