]> git.openstreetmap.org Git - chef.git/commitdiff
imagery: use titiler over socket
authorGrant Slater <github@firefishy.com>
Mon, 1 Jul 2024 16:02:02 +0000 (17:02 +0100)
committerGrant Slater <github@firefishy.com>
Mon, 1 Jul 2024 16:02:02 +0000 (17:02 +0100)
cookbooks/imagery/recipes/default.rb
cookbooks/imagery/recipes/tiler.rb
cookbooks/imagery/templates/default/nginx_imagery.conf.erb

index 9cf0692f2a6244acd9f6c86bd9bc4adb7b846395..3c04dd8a36934b9d70b38b3e91df3bfbe4ede8a0 100644 (file)
@@ -64,6 +64,13 @@ directory "/srv/imagery/common" do
   recursive true
 end
 
+directory "/srv/imagery/sockets" do
+  owner "root"
+  group "root"
+  mode "777"
+  recursive true
+end
+
 # Pre-download uk_os_OSTN15_NTv2_OSGBtoETRS.tif used for EPSG:27700 conversions
 execute "uk_os_OSTN15_NTv2_OSGBtoETRS.tif" do
   command "projsync --file uk_os_OSTN15_NTv2_OSGBtoETRS.tif --system-directory"
index 7358089acef027e8d8f8809ee91751938471b3e1..cc115e7ac283b7fa431f9a5638a5e2d25eb35ef1 100644 (file)
@@ -37,9 +37,9 @@ container_image = if arm?
 podman_service "titiler" do
   description "Container service for titiler"
   image container_image
-  ports 8080 => 8080
-  volume "/store/imagery" => "/store/imagery"
-  environment :PORT                                => 8080,
+  volume "/store/imagery" => "/store/imagery",
+         "/srv/imagery/sockets" => "/sockets"
+  environment :BIND                                => "unix:/sockets/titiler.sock",
               :WORKERS_PER_CORE                    => 1,
               :GDAL_CACHEMAX                       => 200,
               :GDAL_DISABLE_READDIR_ON_OPEN        => "EMPTY_DIR",
index ea9730a95d2ba3c90012b78c1b6f0f3c8e230bd5..81f82922592cf66eb9bbbe0cfd690b19a4df0f2e 100644 (file)
@@ -9,9 +9,9 @@ server {
 
 <% if @uses_tiler -%>
 upstream <%= @name %>_tiler_backend {
-    server 127.0.0.1:8080 max_fails=0;
+    server unix:/srv/imagery/sockets/titiler.sock max_fails=0;
 
-    keepalive 32;
+    keepalive 8;
 }
 <% else -%>
 upstream <%= @name %>_fastcgi {