From 96fd2276d8e7f3fcefe20ad9d055c93d16e4313e Mon Sep 17 00:00:00 2001 From: okkdev Date: Sat, 24 Dec 2022 00:56:01 +0100 Subject: [PATCH] add nomad job --- chuko.nomad | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 chuko.nomad diff --git a/chuko.nomad b/chuko.nomad new file mode 100644 index 0000000..e291639 --- /dev/null +++ b/chuko.nomad @@ -0,0 +1,48 @@ +job "chuko" { + datacenters = ["dc1"] + type = "service" + + group "chuko" { + count = 1 + + network { + port "http" { + to = 4000 + } + } + + service { + name = "chuko" + port = "http" + provider = "nomad" + + tags = [ + "traefik.enable=true", + "traefik.http.routers.chuko.rule=Host(`chuko.gay`)", + "traefik.http.routers.chuko.tls=true", + "traefik.http.routers.chuko.tls.certresolver=letsencrypt" + ] + } + + task "chuko" { + driver = "docker" + + config { + image = "ghcr.io/okkdev/chuko" + ports = ["http"] + } + + env { + // Generate a new one with `mix phx.gen.secret` + SECRET_KEY_BASE = "1Lvd0uSlGOblVBx6es3UFyCLxQPh45Vi+VBEbYyIb8D4LEv70VGT+RNK6V2RxYRn" + PHX_HOST = "chuko.gay" + DATABASE_PATH = "/app/chuko.db" + } + + resources { + cpu = 1000 + memory = 1000 + } + } + } +} \ No newline at end of file