File size: 665 Bytes
9a6d5fb
 
dfc44d3
9a6d5fb
 
 
 
 
dfc44d3
9a6d5fb
 
 
 
 
 
dfc44d3
9a6d5fb
 
 
 
 
 
 
dfc44d3
9a6d5fb
dfc44d3
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# Base image: lightweight Python 3.10 (works well on Hugging Face)
FROM python:3.10-slim

# Install Java (OpenJDK 17 via default-jdk)
RUN apt-get update && \
    apt-get install -y default-jdk curl && \
    apt-get clean && \
    rm -rf /var/lib/apt/lists/*

# Set environment variables
ENV JAVA_HOME=/usr/lib/jvm/java-17-openjdk-amd64
ENV PATH="$JAVA_HOME/bin:$PATH"

# Install Python dependencies
COPY requirements.txt /app/requirements.txt
WORKDIR /app
RUN pip install --no-cache-dir -r requirements.txt

# Copy app files
COPY . /app

# Expose FastAPI port
EXPOSE 7860

# Run FastAPI with Uvicorn
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]