# Use an official lightweight Python runtime as a parent image FROM python:3.9-slim # Set the working directory inside the container WORKDIR /app # Copy the file that lists the dependencies to the working directory COPY requirements.txt . # Install the dependencies from requirements.txt # --no-cache-dir ensures the image is smaller RUN pip install --no-cache-dir -r requirements.txt # Copy all the other files from your local project folder (app.py, model.pkl) # into the container's working directory COPY . . # Inform Docker that the container listens on port 8080 at runtime EXPOSE 8080 # Define the command to run your application # This will execute "python app.py" when the container starts CMD ["python", "app.py"]