# Use an official Python runtime as a parent image FROM python:3.11-slim # Install any system dependencies (for example, gcc may be needed for some Python packages) RUN apt-get update && apt-get install -y gcc # Set the working directory to /app WORKDIR /app # Copy the requirements file into the container at /app COPY requirements.txt . # Upgrade pip and install any needed packages specified in requirements.txt RUN pip install --upgrade pip && pip install -r requirements.txt # Copy the rest of the application code into the container COPY . . # Expose port 7860 (or any other port your Flask app uses) EXPOSE 7860 # Define environment variable for Flask (optional) ENV FLASK_APP=app.py # Run the application CMD ["python", "app.py"]