From cde92a8c2740ed9ccf335da098fa5f1d00fdbd65 Mon Sep 17 00:00:00 2001 From: Udo Waechter Date: Wed, 28 Feb 2024 10:57:22 +0100 Subject: [PATCH] openwrt http-server --- apps/openwrt/live.hcl | 56 +++++++++++++++++++++++++++++++++++++++++ apps/openwrt/volume.hcl | 20 +++++++++++++++ 2 files changed, 76 insertions(+) create mode 100644 apps/openwrt/live.hcl create mode 100644 apps/openwrt/volume.hcl diff --git a/apps/openwrt/live.hcl b/apps/openwrt/live.hcl new file mode 100644 index 0000000..e98e42c --- /dev/null +++ b/apps/openwrt/live.hcl @@ -0,0 +1,56 @@ +job "openwrt" { + datacenters = ["nummer5"] + + group "apps" { + count = 1 + + network { + port "http"{ + to = 9091 + } + } + + service { + name = "openwrt" + port = "http" + + tags = [ + "traefik.enable=true", + "traefik.http.routers.openwrt.rule=Host(`openwrt.service.nr5`)", + ] + + } + + volume "openwrt" { + type = "csi" + read_only = false + source = "openwrt" + access_mode = "single-node-writer" + attachment_mode = "file-system" + } + + task "openwrt" { + driver = "podman" + + config { + image = "docker.io/jitesoft/lighttpd" + ports = ["http"] + } + env { + PORT = 9091 + SERVER_ROOT = "/www" + SERVER_NAME = "openwrt.service.nr5" + } + + volume_mount { + volume = "openwrt" + destination = "/www" + } + + resources { + cpu = 10 + memory = 32 + } + } + } +} diff --git a/apps/openwrt/volume.hcl b/apps/openwrt/volume.hcl new file mode 100644 index 0000000..37e1ae8 --- /dev/null +++ b/apps/openwrt/volume.hcl @@ -0,0 +1,20 @@ +type = "csi" +id = "openwrt" +name = "openwrt" +plugin_id = "nfs" + +capability { + access_mode = "single-node-writer" + attachment_mode = "file-system" +} + +context { + server = "ebin01.wks" + share = "/data/raid1-ssd/app-data/openwrt" + mountPermissions = "0" +} + +mount_options { + fs_type = "nfs" + mount_flags = [ "timeo=30", "vers=3", "_netdev" , "nolock" ] +} \ No newline at end of file