# Use lightweight Python image FROM python:3.10-slim # Set environment ENV PYTHONDONTWRITEBYTECODE 1 ENV PYTHONUNBUFFERED 1 # Set working directory to root project dir WORKDIR /code # Install build dependencies if needed RUN apt-get update && apt-get install -y build-essential && rm -rf /var/lib/apt/lists/* # Install Python packages COPY requirements.txt . RUN pip install --no-cache-dir -r requirements.txt # Copy all source code into container COPY . . # Expose port Flask will run on EXPOSE 7860 # change mod 777 RUN mkdir -p /data/uploaded && chmod -R 777 /data # Run your main Flask app CMD ["python", "main.py"]