# Use Python 3.11 slim image | |
FROM python:3.11-slim | |
# Set environment variables for Java and cache directory | |
ENV JAVA_HOME=/usr/lib/jvm/java-17-openjdk-amd64 | |
ENV XDG_CACHE_HOME=/tmp/.cache | |
ENV PATH="${JAVA_HOME}/bin:${PATH}" | |
# Set working directory | |
WORKDIR /app | |
# Install Java 17 and build tools | |
RUN apt-get update && apt-get install -y --no-install-recommends \ | |
openjdk-17-jdk \ | |
build-essential \ | |
curl \ | |
&& rm -rf /var/lib/apt/lists/* | |
# Copy app code (app.py etc.) | |
COPY . . | |
# Upgrade pip | |
RUN pip install --upgrade pip | |
# Install your PyPI package with solrnormalization extras | |
RUN pip install "impresso_pipelines[solrnormalization]==0.4.6.4" | |
# Install gradio if not already pulled in | |
RUN pip install gradio | |
# Expose Gradio default port | |
EXPOSE 7860 | |
# Run the app | |
CMD ["python", "app.py"] | |