FROM python:3.10.0-slim # Set up the environment ENV PYTHONDONTWRITEBYTECODE 1 ENV PYTHONUNBUFFERED 1 ENV HF_HOME=/app/.cache # Install dependencies RUN pip install --upgrade pip # Create and set working directory WORKDIR /app # Copy the application code COPY . /app # Create a cache directory with appropriate permissions RUN mkdir -p /app/.cache && chown -R 1000:1000 /app/.cache # Install the dependencies RUN pip install -r requirements.txt # Expose the port and define the entrypoint EXPOSE 7860 CMD ["gunicorn", "--bind", "0.0.0.0:7860", "--workers", "2", "--timeout", "120", "app:app"]