Starter repo for Node.js (with typescript) applications with Express. This template repo can also be used to accelerate deployment of PoC to GCP.
yarnyarn run devdocker build --platform=linux/amd64 -t minimal-typescript-express .docker run -p 3000:3000 minimal-typescript-express-
Install Google Cloud CLI
./gcp_setup_docker_repo.sh --name minimal-typescript-express --project_id your-gcp-project-id./gcp_deploy.sh --name minimal-typescript-express --project_id your-gcp-project-id./gcp_setup_loadbalancing.sh --name minimal-typescript-express --project_id your-gcp-project-id-
List your created Static IP. You should be able to access Cloud Run service on the IP address within 10 minutes.
Create A records for your domain www.example.com and example.com
gcloud compute addresses listand setup A records on your domain registrar
www A 30.90.80.100
@ A 30.90.80.100
Delete all created resources
./gcp_cleanup.sh --name minimal-typescript-express --project_id your-gcp-project-id- Auth to gcp
gcloud auth login- Set active gcp project
PROJECT_ID=my_gcp_project_id
gcloud config set project $PROJECT_ID- Tag docker image and push to gcp repo.
docker tag $APP_NAME eu.gcr.io/$PROJECT_ID/minimal-typescript-express
docker push eu.gcr.io/$PROJECT_ID/minimal-typescript-express- Deploy to Cloud Run
gcloud run deploy minimal-typescript-express --image eu.gcr.io/$PROJECT_ID/minimal-typescript-express \
--platform managed \
--region europe-north1 \
--allow-unauthenticatedgcloud run services listDeleting cloud run service
gcloud run services delete minimal-typescript-express