-
Launch gcloud
gcloud init -
Export your project id variable name
export PROJECT_ID=your-project-name -
Set your project
gcloud config set project $PROJECT_ID -
Enable needed services
gcloud services enable run.googleapis.com cloudbuild.googleapis.com -
Build the Image
gcloud builds submit --tag gcr.io/$PROJECT_ID/fastapi-app -
Deploy
gcloud run deploy fastapi-app \ --image gcr.io/$PROJECT_ID/fastapi-app \ --region us-central1 \ --platform managed \ --allow-unauthenticated \ --set-env-vars API_KEY=your-secret-api-key # If you have more than one variable # --set-env-vars API_KEY=your-secret-api-key,DB_URL=your-database-url -
Test get route
curl https://your-cloud-run-url/ -
Test the post url
curl -X POST https://fastapi-app-949091418184.us-central1.run.app/data \ -H "Content-Type: application/json" \ -H "x-api-key: your-secret-api-key" \ -d '{"example": "data"}'
-
Notifications
You must be signed in to change notification settings - Fork 0
jorge-armando-navarro-flores/chatbot_backend
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
About
No description, website, or topics provided.
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published