From 58d0f8f803744ed79bd056f2b143f8c039f31b7e Mon Sep 17 00:00:00 2001 From: wizzdom Date: Wed, 14 Aug 2024 01:06:01 +0100 Subject: [PATCH] add minio (#48) --- jobs/services/minio.hcl | 68 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100644 jobs/services/minio.hcl diff --git a/jobs/services/minio.hcl b/jobs/services/minio.hcl new file mode 100644 index 0000000..b9e9152 --- /dev/null +++ b/jobs/services/minio.hcl @@ -0,0 +1,68 @@ +job "minio" { + datacenters = ["aperture"] + + type = "service" + + group "minio" { + count = 1 + + network { + port "api" { + } + port "console" { + } + } + + service { + name = "minio-console" + port = "console" + + check { + type = "http" + path = "/" + interval = "10s" + timeout = "2s" + } + + tags = [ + "traefik.enable=true", + "traefik.http.routers.minio-api.service=minio-api", + "traefik.http.services.minio-api.loadbalancer.server.port=${NOMAD_PORT_api}", + "traefik.http.routers.minio-api.rule=Host(`cdn.redbrick.dcu.ie`)", + "traefik.http.routers.minio-api.entrypoints=web,websecure", + "traefik.http.routers.minio-api.tls.certresolver=lets-encrypt", + + "traefik.http.routers.minio-console.service=minio-console", + "traefik.http.services.minio-console.loadbalancer.server.port=${NOMAD_PORT_console}", + "traefik.http.routers.minio-console.rule=Host(`minio.rb.dcu.ie`)", + "traefik.http.routers.minio-console.entrypoints=web,websecure", + "traefik.http.routers.minio-console.tls.certresolver=lets-encrypt", + ] + } + + task "minio" { + driver = "docker" + + config { + image = "quay.io/minio/minio" + ports = ["api", "console"] + + command = "server" + args = ["/data", "--address", ":${NOMAD_PORT_api}", "--console-address", ":${NOMAD_PORT_console}"] + + volumes = [ + "/storage/nomad/minio:/data", + ] + } + template { + destination = "local/.env" + env = true + change_mode = "restart" + data = <