webssh.nomad (1454B)
1 # https://github.com/huashengdun/webssh/blob/master/README.md#deployment 2 3 job "webssh" { 4 datacenters = ["dc1"] 5 6 vault {} 7 8 group "server" { 9 count = 1 10 11 volume "tls" { 12 type = "csi" 13 source = "certbot" 14 access_mode = "multi-node-multi-writer" 15 attachment_mode = "file-system" 16 } 17 18 network { 19 port "http" { 20 } 21 port "https" { 22 static = 44414 23 } 24 } 25 26 task "nginx" { 27 driver = "podman" 28 29 config { 30 image = "docker.io/library/nginx:stable-alpine" 31 ports = ["https"] 32 volumes = [ 33 # mount the templated config from the task directory to the container 34 "local/webssh.conf:/etc/nginx/conf.d/webssh.conf", 35 ] 36 } 37 38 volume_mount { 39 volume = "tls" 40 destination = "/etc/letsencrypt" 41 } 42 43 template { 44 destination = "${NOMAD_TASK_DIR}/webssh.conf" 45 data = file("./templates/nginx.conf.tmpl") 46 } 47 48 resources { 49 memory = 50 50 memory_max = 256 51 cpu = 200 52 } 53 } 54 55 task "webssh" { 56 driver = "podman" 57 58 config { 59 image = "haproxy.lan:5000/webssh:latest" 60 command = "/usr/local/bin/python3" 61 args = ["run.py", "--address=0.0.0.0", "--port=${NOMAD_PORT_http}"] 62 force_pull = true 63 ports = ["http"] 64 } 65 66 resources { 67 memory = 512 68 memory_max = 1024 69 cpu = 500 70 } 71 } 72 } 73 }