{"id":20314747,"url":"https://github.com/mazzasaverio/fastapi-cloudrun-starter","last_synced_at":"2025-04-11T17:20:47.403Z","repository":{"id":215757000,"uuid":"739711270","full_name":"mazzasaverio/fastapi-cloudrun-starter","owner":"mazzasaverio","description":"FastAPI on Cloud Run v2: Terraform setup, GitHub Actions CI, Cloud Build triggers, Secret Manager integration","archived":false,"fork":false,"pushed_at":"2024-02-06T16:51:43.000Z","size":32,"stargazers_count":17,"open_issues_count":0,"forks_count":3,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-25T13:11:32.697Z","etag":null,"topics":["cloud-build","cloud-run","fastapi","gcp","gcp-secret-manager","github-actions","serveless","terraform"],"latest_commit_sha":null,"homepage":"","language":"HCL","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mazzasaverio.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2024-01-06T10:03:38.000Z","updated_at":"2025-02-26T13:08:37.000Z","dependencies_parsed_at":"2024-01-11T15:49:01.161Z","dependency_job_id":"600fb863-1e6b-4bdc-a031-da715ec5f366","html_url":"https://github.com/mazzasaverio/fastapi-cloudrun-starter","commit_stats":null,"previous_names":["mazzasaverio/template-image-cloud-run","mazzasaverio/fastapi-cloudrun-starter"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mazzasaverio%2Ffastapi-cloudrun-starter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mazzasaverio%2Ffastapi-cloudrun-starter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mazzasaverio%2Ffastapi-cloudrun-starter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mazzasaverio%2Ffastapi-cloudrun-starter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mazzasaverio","download_url":"https://codeload.github.com/mazzasaverio/fastapi-cloudrun-starter/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248447609,"owners_count":21105140,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cloud-build","cloud-run","fastapi","gcp","gcp-secret-manager","github-actions","serveless","terraform"],"created_at":"2024-11-14T18:16:34.815Z","updated_at":"2025-04-11T17:20:47.381Z","avatar_url":"https://github.com/mazzasaverio.png","language":"HCL","funding_links":[],"categories":[],"sub_categories":[],"readme":"# FastAPI CloudRun Starter\n\nThis repository serves as a starter template for setting up a FastAPI backend using Google CloudRun. It's designed to streamline the process of deploying a FastAPI application using modern infrastructure as code principles.\n\n## Features\n\n- Terraform-based infrastructure setup.\n- Integration with GitHub Actions for continuous integration.\n- Automatic trigger setup for Cloud Build.\n- Secure storage of secrets using Secret Manager.\n\n## Getting Started\n\n### Prerequisites\n\n1. **Google Cloud Platform Account**: Ensure you have an active GCP account. [Sign up here](https://cloud.google.com/) if needed.\n2. **Project Setup**: Create a new GCP project and note down the project ID.\n3. **Service Account**: Create a service account with 'Owner' permissions in your GCP project and generate a JSON key file.\n4. **Connecting Cloud Build to Your GitHub Account**: Create a personal access token in GitHub with `repo` and `read:user` permissions. For organization apps, include `read:org` permission. [Guide here](https://cloud.google.com/build/docs/automating-builds/github/connect-repo-github?generation=2nd-gen#terraform_1).\n\n### Terraform Configuration\n\n- **Rename File**: Rename `terraform.tfvars.example` to `terraform.tfvars`.\n- **Insert Credentials**: Fill in your credentials in the `terraform.tfvars` file.\n\n### Docker Configuration\n\nThe `Dockerfile` is configured to use the NVIDIA CUDA base image with FastAPI dependencies. The application is exposed on port 8000 and can be customized as needed.\n\n### FastAPI Application\n\nThe `main.py` script is the entry point for the FastAPI application. It includes basic routes and can be extended for additional functionality.\n\n## Usage\n\nTo deploy the infrastructure and application:\n\n1. Initialize Terraform:\n   ```bash\n   terraform init\n   ```\n2. Apply Terraform configuration:\n   ```bash\n   terraform apply\n   ```\n3. To build and run the Docker container locally, use:\n   ```bash\n   docker-compose up --build\n   ```\n\n## Contributing\n\nContributions to enhance this starter template are welcome. Please follow standard GitHub contribution guidelines.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmazzasaverio%2Ffastapi-cloudrun-starter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmazzasaverio%2Ffastapi-cloudrun-starter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmazzasaverio%2Ffastapi-cloudrun-starter/lists"}