FROM python:3.9 WORKDIR /code COPY ./requirements.txt /code/requirements.txt # Set cache directory permissions to prevent HF errors RUN mkdir -p /code/cache && chmod 777 /code/cache ENV HF_HOME=/code/cache RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt COPY . . # Ensure submissions directory exists and is writable RUN mkdir -p /code/submissions && chmod 777 /code/submissions # Expose port 7860 EXPOSE 7860 CMD ["gunicorn", "-b", "0.0.0.0:7860", "app:app"]