# Base image FROM python:3.9-slim # Set environment variables ENV PYTHONUNBUFFERED=1 ENV PYTHONDONTWRITEBYTECODE=1 ENV HF_HOME=/app/cache # Set working directory WORKDIR /app # Create the cache directory and set permissions RUN mkdir -p /app/cache && chmod -R 777 /app/cache # Install dependencies COPY requirements.txt /app/ RUN pip install --no-cache-dir -r requirements.txt # Copy application code COPY . /app/ # Expose the application port EXPOSE 5000 # Run the application CMD ["python", "app.py"]