Skip to content

Commit

Permalink
Infra/api service probes (#66)
Browse files Browse the repository at this point in the history
* Comment out and document code to create a DB user.

* Add probes to API service.
  • Loading branch information
anybodys authored Jun 10, 2024
1 parent 6cfaf7b commit 6a30b7e
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 6a30b7e

Please sign in to comment.