weather-rust
A simple, containerized Rust web server for fetching weather information, designed for deployment on Google Cloud Run.
Overview
This project provides a basic "Hello, World!" style web application written in Rust. It serves as a template and example for building and deploying a minimal, secure, and efficient Rust application on Google Cloud Run using Docker and Google Cloud Build.
Technologies Used
- Language: Rust
 - Web Framework: Hyper
 - Containerization: Docker
 - Deployment: Google Cloud Run
 - CI/CD: Google Cloud Build
 
Getting Started
A Makefile is included to simplify common development tasks.
Prerequisites
Before you begin, ensure you have the following installed:
Initial Setup
Clone the repository and install the necessary dependencies:
Development Workflow
The following commands are available through the Makefile.
Building the Project
- Development Build:
 - Release Build (optimized for production):
 
Running Locally
To start the server on http://localhost:8080:
Code Quality
- Format the code:
 - Lint the code with Clippy:
 
Testing
Run the test suite:
Deployment
Deployment is automated via Google Cloud Build, as defined in cloudbuild.yaml. The process uses a multi-stage Dockerfile to build a minimal, secure production image based on gcr.io/distroless/cc-debian12.
To manually trigger a deployment, run:
This command will:
- Submit a build to Google Cloud Build.
 - Build and push the Docker image to Google Container Registry (GCR).
 - Deploy the new image to the 
cloudrun-rustservice in theus-central1region.