Skip to content

An example service running on Google Cloud Run

License

Notifications You must be signed in to change notification settings

CapybaraOrg/template-service

Repository files navigation

Template Service

An example service running on Google Cloud Run

Building and running locally

Start Docker daemon:

colima start

Build and run the database:

docker rm main

docker run --name main \
  -e POSTGRES_USER=main  \
  -e POSTGRES_PASSWORD=mysecretpassword \
  -e POSTGRES_DB=main \
  -p 5432:5432 \
  -d \
  --net=host \
  postgres:14

Build and run the application:

./gradlew clean build
docker build -t template-service:0.0.0-development .
docker image tag template-service:0.0.0-development template-service:latest
docker run -p 8080:8080 --net=host template-service:0.0.0-development

Building and deploying on Google Cloud Run from the local machine

Building Docker image

./gradlew clean build
docker build -t {Docker repository}/template-service:0.0.0-development .
docker image tag {Docker repository}/template-service:0.0.0-development {Docker repository}/template-service:latest
docker image push --all-tags {Docker repository}/template-service

Replace {Docker repository} Artifact Registry repository, please see the documentation for more information

Deploying on Google Cloud Run

gcloud run deploy template-service \
  --image {Docker repository}/template-service:latest \
  --allow-unauthenticated \
  --region={Region} \
  --add-cloudsql-instances={Cloud SQL instance connection name}

About

An example service running on Google Cloud Run

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published