summaryrefslogtreecommitdiff
path: root/jobs/homepage/homepage.nomad.hcl
diff options
context:
space:
mode:
authorMathias Magnusson <mathias@magnusson.space>2023-08-21 19:26:58 +0200
committerMathias Magnusson <mathias@magnusson.space>2023-08-21 20:45:49 +0200
commitafcec91855d15349f068315eebe131f936ee10d6 (patch)
tree03ac280d5a320baa68a80def56723ca23e3083c4 /jobs/homepage/homepage.nomad.hcl
parente9336eea2aa118216b0a833e19b19321e57d22e3 (diff)
downloadgarm-afcec91855d15349f068315eebe131f936ee10d6.tar.gz
Add home page
Diffstat (limited to 'jobs/homepage/homepage.nomad.hcl')
-rw-r--r--jobs/homepage/homepage.nomad.hcl62
1 files changed, 62 insertions, 0 deletions
diff --git a/jobs/homepage/homepage.nomad.hcl b/jobs/homepage/homepage.nomad.hcl
new file mode 100644
index 0000000..1544f1e
--- /dev/null
+++ b/jobs/homepage/homepage.nomad.hcl
@@ -0,0 +1,62 @@
+job "homepage" {
+ group "web" {
+ count = 1
+
+ network {
+ port "http" {
+ to = 80
+ }
+ }
+
+ service {
+ name = "homepage"
+ port = "http"
+ provider = "nomad"
+
+ tags = [
+ "nginx.hostname=.magnusson.wiki",
+ "nginx.certname=magnusson.wiki",
+ ]
+ }
+
+ task "web" {
+ driver = "docker"
+
+ 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/homepage/index.html")
+ destination = "local/html/index.html"
+ }
+
+ artifact {
+ source = "https://files.magnusson.space/images/epost.png"
+ destination = "local/html/"
+ }
+ }
+ }
+}