This guide explains how to deploy the application using the Cloud Run service. The project is configured to use uv, a high-performance Python package manager, ensuring fast and deterministic builds.
Ensure you have the Google Cloud CLI installed and initialized.
# Verify installation
gcloud --versionRun these commands in your terminal (from the project root) to configure the environment:
# 1. Login to Google Cloud
gcloud auth login
# 2. Create the project (or skip if you have one)
# Replace 'math-mentor-prod' with your unique project ID
gcloud projects create math-mentor-prod --name="Math Mentor"
gcloud config set project math-mentor-prod
# 3. Enable necessary Google Cloud APIs
gcloud services enable run.googleapis.com \
artifactregistry.googleapis.com \
cloudbuild.googleapis.comExecute this single command to build and launch the application.
gcloud run deploy math-mentor \
--source . \
--region us-central1 \
--allow-unauthenticated \
--set-env-vars="GOOGLE_API_KEY=your_actual_api_key_here"Configuration Details:
--source .: Uses the localDockerfile(which leveragesuv sync).--allow-unauthenticated: Makes the application accessible via public URL.--set-env-vars: Securely injects your API key.
Upon success, the terminal will display a Service URL:
https://math-mentor-abc123xyz.a.run.app
Click the link to verify your deployed Math Mentor!