# Use an official Python runtime as a parent image FROM python:3.11-slim # Set the working directory in the container WORKDIR /app # Install system dependencies if needed RUN apt-get update && apt-get install -y \ build-essential \ && rm -rf /var/lib/apt/lists/* # Copy the requirements file into the container at /app COPY requirements.txt . # Install any needed packages specified in requirements.txt RUN pip install --no-cache-dir -r requirements.txt # Copy the current directory contents into the container at /app COPY . . # Expose port 7860 for the Flask app EXPOSE 7860 # Define environment variable ENV FLASK_APP=app.py ENV PORT=7860 # Run app.py when the container launches CMD ["python", "app.py"]