# Use Python 3.10 slim as base image FROM python:3.10-slim # Install OpenJDK 11 (includes javac) RUN apt-get update && \ apt-get install -y openjdk-17-jdk && \ apt-get clean && \ rm -rf /var/lib/apt/lists/* # Set JAVA_HOME and update PATH ENV JAVA_HOME=/usr/lib/jvm/java-17-openjdk-amd64 ENV PATH=$JAVA_HOME/bin:$PATH # Verify Java installation RUN java -version && javac -version # Set working directory WORKDIR /home/user/app # Copy application files COPY . . # Install Python dependencies RUN pip install --no-cache-dir -r requirements.txt # Expose port for HF Spaces EXPOSE 7860 # Run the Flask app CMD ["python", "app.py"]