# Use a Python base image, preferably a slim version FROM python:3.11-slim # Set the working directory inside the container WORKDIR /app # Copy the dependency file and install them COPY requirements.txt requirements.txt RUN pip install --no-cache-dir -r requirements.txt # Copy your saved model and the application code # Assuming your model folder is named 'saved_human_ai_model' COPY saved_human_ai_model ./saved_human_ai_model COPY ./app.py ./app.py # Expose the port (Cloud Run uses environment variable $PORT, but 8080 is a good default) EXPOSE 8080 # Define the command to run the FastAPI application using Uvicorn # The command format is: uvicorn [ASGI_MODULE]:[ASGI_APP_OBJECT] --host 0.0.0.0 --port $PORT CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"] # NOTE: Cloud Run automatically maps the internal port 8080 to the external port