FROM python:3.9-slim # Install Java (required by STOUT) RUN apt-get update && \ apt-get install -y openjdk-21-jre-headless && \ apt-get clean && \ rm -rf /var/lib/apt/lists/* # Set working directory WORKDIR /app # Create data directory for PyStow with proper permissions RUN mkdir -p /app/.data && chmod 777 /app/.data # Copy requirements first for better caching COPY requirements.txt . # Install Python dependencies RUN pip install --no-cache-dir -r requirements.txt # Copy application code COPY app.py . # Expose port EXPOSE 7860 # Set environment variables ENV JAVA_HOME=/usr/lib/jvm/java-21-openjdk-amd64 ENV PYSTOW_HOME=/app/.data # Run the application CMD ["python", "app.py"]