# Use the official Python image as the base image FROM python:3.9 # Set the working directory inside the container WORKDIR /app # Copy the requirements file first (for caching) COPY requirements.txt . # Install required Python packages RUN pip install --no-cache-dir -r requirements.txt # Copy the rest of the project files COPY . . # Ensure the uploads directory exists and is writable RUN mkdir -p /app/static/uploads && chmod -R 777 /app/static/uploads # Expose the port Flask runs on EXPOSE 7860 # Command to run the Flask app using Gunicorn CMD ["gunicorn", "-w", "4", "-b", "0.0.0.0:7860", "app:app"]