reranking / Dockerfile
ICTuniverse's picture
Update Dockerfile
8c8b611 verified
raw
history blame contribute delete
943 Bytes
# Use Python 3.10 slim as base image
FROM python:3.10-slim
# Install OpenJDK 17 (includes javac and libjvm.so)
RUN apt-get update && \
apt-get install -y openjdk-17-jdk && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
# Find the actual JAVA_HOME path dynamically
RUN update-alternatives --config java || true
RUN echo "JAVA_HOME=$(dirname $(dirname $(readlink -f $(which java))))" >> /etc/environment
# 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 echo "Checking Java installation..." && \
java -version && \
javac -version && \
echo "Java installed successfully!"
# 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"]