diff --git a/config/deploy/production.hcl b/config/deploy/production.hcl new file mode 100644 index 0000000..4a8b30d --- /dev/null +++ b/config/deploy/production.hcl @@ -0,0 +1,55 @@ +variable "branch_or_sha" { + type = string + default = "main" +} +job "imagecat-production" { + region = "global" + datacenters = ["dc1"] + node_pool = "production" + type = "service" + group "web" { + count = 2 + network { + port "http" { to = 3000 } + } + service { + port = "http" + check { + type = "http" + port = "http" + path = "/" + interval = "10s" + timeout = "1s" + } + } + task "webserver" { + driver = "podman" + config { + image = "ghcr.io/pulibrary/imagecat-rails:${ var.branch_or_sha }" + ports = ["http"] + force_pull = true + } + template { + destination = "${NOMAD_SECRETS_DIR}/env.vars" + env = true + change_mode = "restart" + data = <