FROM python:3.10-slim # Set working directory WORKDIR /app # Copy requirements first to leverage Docker cache COPY requirements.txt . # Install dependencies and clean cache RUN pip install --no-cache-dir -r requirements.txt && \ rm -rf /root/.cache/huggingface && \ rm -rf /root/.cache/pip # Copy only what's needed COPY main/ ./main/ # Set environment variables ENV PYTHONPATH=/app ENV PYTHONUNBUFFERED=1 # Clear any cache that might have been created RUN rm -rf ~/.cache/huggingface # Expose the port EXPOSE 7680 # Use same command as working version CMD ["python", "-m", "main.app"]