From d4842154766fbe07f6dca79cd916b89feb54b39c Mon Sep 17 00:00:00 2001 From: Petru Paler Date: Mon, 2 Sep 2024 14:35:47 +0100 Subject: [PATCH] WIP: qgis & lizmap config --- services/maps.hcl | 114 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 114 insertions(+) create mode 100644 services/maps.hcl diff --git a/services/maps.hcl b/services/maps.hcl new file mode 100644 index 0000000..c316c33 --- /dev/null +++ b/services/maps.hcl @@ -0,0 +1,114 @@ +job "maps" { + datacenters = ["alo"] + + # force each evaluation to be different, so that the jobspec changes, so that the latest image is pulled + # otherwise, nomad run ends up not doing anything even if the latest image is different + meta { + uuid = uuidv4() + } + + group "qgis" { + network { + port "http" { + to = 8080 + } + } + + task "py-server" { + driver = "docker" + + config { + image = "3liz/qgis-map-server:3.38" + ports = ["http"] + volumes = [ + "/data/shared/alo_gis:/projects", + "/data/compute/appdata/qgis-server-plugins:/plugins", + ] + } + + env { + QGSRV_API_ENABLED_LIZMAP = "yes" + QGSRV_SERVER_WORKERS = 4 + QGSRV_SERVER_HTTP_PROXY = "yes" + QGSRV_SERVER_PROXY_URL = "https://mapserver.v.paler.net" + QGSRV_SERVER_PLUGINPATH = "/plugins" + QGSRV_LOGGING_LEVEL = "INFO" + QGSRV_CACHE_ROOTDIR = "/projects" + QGSRV_TRUST_LAYER_METADATA = "yes" + QGSRV_DISABLE_GETPRINT = "yes" + QGIS_SERVER_LIZMAP_REVEAL_SETTINGS = "yes" + } + + service { + name = "mapserver" + port = "http" + + tags = [ + "traefik.enable=true", + "traefik.http.routers.mapserver.entryPoints=websecure", + #"traefik.http.routers.mapserver.middlewares=authentik@file", + ] + } + + resources { + memory = 3000 + cpu = 4000 + } + } + } + + group "lizmap" { + network { + port "http" { + to = 8080 + } + } + + task "server" { + driver = "docker" + + config { + image = "3liz/lizmap-web-client:3.8.0-rc.4" + ports = ["http"] + volumes = [ + "/data/shared/alo_gis:/srv/projects", + "/data/compute/appdata/maps/var/lizmap-theme-config:/www/lizmap/var/lizmap-theme-config", + "/data/compute/appdata/maps/var/lizmap-config:/www/lizmap/var/config", + "/data/compute/appdata/maps/var/lizmap-db:/www/lizmap/var/db", + "/data/compute/appdata/maps/var/lizmap-log:/www/lizmap/var/log", + "/data/compute/appdata/maps/var/lizmap-modules:/www/lizmap/var/lizmap-modules", + "/data/compute/appdata/maps/var/lizmap-my-packages:/www/lizmap/var/my-packages", + "/data/compute/appdata/maps/www:/www/lizmap/www", + "/data/compute/appdata/maps/etc:/srv/etc:ro", + ] + + command = "php-fpm" + } + + env { + LIZMAP_CACHEREDISDB = "1" + LIZMAP_CACHEREDISHOST = "redis.service.consul" + LIZMAP_CACHESTORAGETYPE = "redis" + LIZMAP_HOME = "/srv/lizmap" + LIZMAP_WMSSERVERURL = "https://mapserver.v.paler.net/ows/" + LIZMAP_CONFIG_INCLUDE = "/srv/etc" + } + + service { + name = "lizmap" + port = "http" + + tags = [ + "traefik.enable=true", + "traefik.http.routers.lizmap.entryPoints=websecure", + "traefik.http.routers.lizmap.middlewares=authentik@file", + ] + } + + resources { + memory = 2000 + cpu = 1000 + } + } + } +}