Skip to content

Commit

Permalink
Add probes to API service.
Browse files Browse the repository at this point in the history
  • Loading branch information
anybodys committed Jun 10, 2024
1 parent e4edc6b commit 3ae83bc
Showing 1 changed file with 16 additions and 4 deletions.
20 changes: 16 additions & 4 deletions infra/app/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ terraform {
source = "hashicorp/google"
version = "5.32.0"
}
postgresql = {
source = "cyrilgdn/postgresql"
version = "1.22.0"
}
#postgresql = {
# source = "cyrilgdn/postgresql"
# version = "1.22.0"
#}
}
backend "gcs" {
bucket = "artist-2d-bucket-tfstate-dev"
Expand Down Expand Up @@ -62,6 +62,18 @@ resource "google_cloud_run_v2_service" "storageapi" {
image = "${local.image_base}storageapi:${local.storageapi_tag}"
# TODO: gunicorn
command = ["python", "manage.py", "runserver", "0.0.0.0:8000"]

startup_probe {
tcp_socket {
port = 8000
}
}
liveness_probe {
http_get {
path = "/api/health"
}
}

env {
name = "ENV"
value = "prod"
Expand Down

0 comments on commit 3ae83bc

Please sign in to comment.