summaryrefslogtreecommitdiff
path: root/jobs/srg/srg.nomad.hcl
diff options
context:
space:
mode:
authorMathias Magnusson <mathias@magnusson.space>2023-08-22 22:12:28 +0200
committerMathias Magnusson <mathias@magnusson.space>2023-08-22 22:12:28 +0200
commit674e0f6b96ec6eae28e731d2cb4fc59bcc70965f (patch)
tree29bf5308499233df8b946a73146ca384382c2833 /jobs/srg/srg.nomad.hcl
parent3a03268818cac52f93d32703fd089904cd5702e1 (diff)
downloadgarm-674e0f6b96ec6eae28e731d2cb4fc59bcc70965f.tar.gz
Add some websites
Diffstat (limited to 'jobs/srg/srg.nomad.hcl')
-rw-r--r--jobs/srg/srg.nomad.hcl62
1 files changed, 62 insertions, 0 deletions
diff --git a/jobs/srg/srg.nomad.hcl b/jobs/srg/srg.nomad.hcl
new file mode 100644
index 0000000..5b88c66
--- /dev/null
+++ b/jobs/srg/srg.nomad.hcl
@@ -0,0 +1,62 @@
+job "srg" {
+ group "web" {
+ count = 1
+
+ network {
+ port "http" {
+ to = 80
+ }
+ }
+
+ service {
+ name = "srg"
+ port = "http"
+ provider = "nomad"
+
+ tags = [
+ "nginx.hostname=.xn--srskildakommandorrelsegruppen-0pc88c.se",
+ "nginx.certname=xn--srskildakommandorrelsegruppen-0pc88c.se",
+ ]
+ }
+
+ task "web" {
+ driver = "docker"
+
+ resources {
+ cpu = 50
+ memory = 20
+ }
+
+ config {
+ image = "nginx:1.25-alpine"
+ ports = ["http"]
+
+ volumes = [
+ "local/config:/etc/nginx/conf.d",
+ "local/html:/var/www/html",
+ ]
+ }
+
+ template {
+ data = <<EOF
+server {
+ listen 80 default_server;
+ listen [::]:80 default_server;
+ http2 on;
+
+ root /var/www/html;
+ location / {
+ index index.html;
+ }
+}
+EOF
+ destination = "local/config/website.conf"
+ }
+
+ template {
+ data = file("jobs/srg/index.html")
+ destination = "local/html/index.html"
+ }
+ }
+ }
+}