File size: 758 Bytes
49bd160 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 | # Use an official Python runtime as a parent image
FROM python:3.9-slim
# Set the working directory in the container
WORKDIR /app
# Copy the requirements file into the container at /app (corrected path)
COPY requirements.txt .
# Install any needed packages specified in requirements.txt
RUN pip install --no-cache-dir -r requirements.txt
# Copy the Flask application file into the container at /app (corrected path)
COPY app.py .
# Copy the trained model file into the container at /app (corrected path)
COPY best_rf_model.joblib .
# Expose the port that the app will run on
EXPOSE 8000
# Run Gunicorn to serve the Flask application
# The 'app:app' refers to the 'app' object in the 'app.py' file
CMD ["gunicorn", "--bind", "0.0.0.0:8000", "app:app"]
|