Spaces:
Sleeping
Sleeping
| # 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"] |