This project demonstrates a simple "Hello World" web application built with Node.js and Express, deployed on Google Cloud Platform (GCP) using Cloud Run.
- Minimal setup with Node.js and Express.
- Dockerized for containerized deployment.
- Easily deployable to GCP's serverless Cloud Run.
- Google Cloud Account with a project set up.
- GCP SDK installed (Install GCP SDK).
- Docker installed (Install Docker).
- Node.js (>=14.0.0) and npm installed (Install Node.js).
-
Clone the repository:
git clone <repository-url> cd gcp-hello-world
-
Install dependencies:
npm install
-
Run the application locally:
npm start
-
Open your browser at http://localhost:8080 to view the app.
-
Authenticate with GCP:
gcloud auth login gcloud config set project [PROJECT_ID] -
Build the Docker image:
docker build -t gcp-hello-world . -
Test the container locally (optional):
docker run -p 8080:8080 gcp-hello-world
-
Deploy the application to Cloud Run:
gcloud run deploy gcp-hello-world \ --source . \ --region us-central1 \ --platform managed \ --allow-unauthenticated -
Once deployed, GCP will provide a URL. Open it in your browser to view the app.
.
├── Dockerfile # Docker configuration for containerizing the app
├── package.json # Node.js dependencies and scripts
├── server.js # Main server file
└── README.md # Project documentation
- Node.js: JavaScript runtime for building scalable applications.
- Express: Web framework for building the application.
- Docker: Containerization of the application.
- Google Cloud Run: Serverless compute platform for deploying the app.
This project is licensed under the MIT License.