Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add E2E example with google-cloud-run #6

Open
thiskevinwang opened this issue Feb 12, 2023 · 0 comments
Open

Add E2E example with google-cloud-run #6

thiskevinwang opened this issue Feb 12, 2023 · 0 comments

Comments

@thiskevinwang
Copy link
Owner

Example: https://express-nixpacks-example-r6og3wfz2a-uc.a.run.app/

project = "express-nixpacks-example"
app "express-nixpacks-example" {
  build {
    use "nixpacks" {}
    registry {
      use "docker" {
        image = "${var.registry_hostname}/${var.gcp_project}/${var.repository_name}/${var.image_name}"
        tag   = var.image_tag
      }
    }
  }

  deploy {
    use "google-cloud-run" {
      project  = var.gcp_project
      location = var.gcp_location

      port = 3000

      static_environment = {
        "NAME" : "World"
      }

      capacity {
        memory                     = 256
        cpu_count                  = 1
        max_requests_per_container = 10
        request_timeout            = 300
      }


      auto_scaling {
        max = 10
      }
    }
  }

  release {
    use "google-cloud-run" {}
  }
}


variable "gcp_location" {
  default     = "us-central1"
  type        = string
  description = "GCP Region"
}

variable "registry_hostname" {
  default     = "us-east1-docker.pkg.dev"
  type        = string
  description = "GCP Artifact Registry Hostname"
}
variable "repository_name" {
  default     = "express-nixpacks-example"
  type        = string
  description = "GCP Repository Name"
}
variable "image_name" {
  default     = "express-nixpacks-example"
  type        = string
  description = "Image name"
}
variable "image_tag" {
  default     = "latest"
  type        = string
  description = "A tag"
}
variable "gcp_project" {
  type        = string
  description = "GCP Project Name; Ex, foo-bar-112233"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant