FROM python:3.9 | |
WORKDIR /code | |
# Ensure the directory exists and has broad permissions | |
RUN mkdir -p /code && chmod -R 777 /code | |
# Copy the requirements file first to leverage Docker cache | |
COPY ./requirements.txt /code/requirements.txt | |
# Install Python dependencies | |
RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt | |
# Copy the rest of the application | |
COPY . . | |
# Adjust permissions for everything in /code, to ensure all files are accessible | |
RUN chmod -R 777 /code | |
CMD ["gunicorn", "-b", "0.0.0.0:7860", "main:app"] |