# Use a lightweight Python base image FROM python:3.10-slim # Set working directory WORKDIR /app # Create and set permissions for COMET cache directory RUN mkdir -p /tmp && chmod 777 /tmp # Copy the project files COPY . . # Install system dependencies (optional – useful for some Python packages) RUN apt-get update && apt-get install -y \ git \ build-essential \ && rm -rf /var/lib/apt/lists/* # Install Python dependencies RUN pip install --upgrade pip RUN pip install --no-cache-dir -r requirements.txt RUN pip install --no-cache-dir unbabel-comet # Environment variables ENV COMET_CACHE="/tmp" # Expose port for Gradio EXPOSE 7860 # Set environment variables ENV OPENAI_API_KEY=${OPENAI_API_KEY} ENV HF_API_TOKEN=${HF_API_TOKEN} ENV COMET_CACHE="/tmp" # Run the Gradio interface CMD ["python", "interface.py"]