5 # Copyright:: 2023, OpenStreetMap Foundation
7 # Licensed under the Apache License, Version 2.0 (the "License");
8 # you may not use this file except in compliance with the License.
9 # You may obtain a copy of the License at
11 # https://www.apache.org/licenses/LICENSE-2.0
13 # Unless required by applicable law or agreed to in writing, software
14 # distributed under the License is distributed on an "AS IS" BASIS,
15 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 # See the License for the specific language governing permissions and
17 # limitations under the License.
20 include_recipe "imagery"
21 include_recipe "podman"
23 directory "/store/imagery" do
30 # FIXME: until upstream supports arm64 images: https://github.com/developmentseed/titiler/pull/740
31 container_image = if arm?
32 "ghcr.io/firefishy/titiler:latest"
34 "ghcr.io/developmentseed/titiler:latest"
37 podman_service "titiler" do
38 description "Container service for titiler"
41 volume "/store/imagery" => "/store/imagery"
42 environment :PORT => 8080,
43 :WORKERS_PER_CORE => 1,
44 :GDAL_CACHEMAX => 200,
45 :GDAL_DISABLE_READDIR_ON_OPEN => "EMPTY_DIR",
46 :GDAL_INGESTED_BYTES_AT_OPEN => 32768,
47 :GDAL_HTTP_MERGE_CONSECUTIVE_RANGES => "YES",
48 :GDAL_HTTP_MULTIPLEX => "YES",
49 :GDAL_HTTP_VERSION => 2,
51 :VSI_CACHE_SIZE => 5000000,
52 :TITILER_API_ROOT_PATH => "/api/v1/titiler",
53 :FORWARDED_ALLOW_IPS => "*" # https://docs.gunicorn.org/en/latest/settings.html#forwarded-allow-ips
56 directory "/var/cache/nginx-cache" do
62 ssl_certificate "tiler.openstreetmap.org" do
63 domains "tiler.openstreetmap.org"
64 notifies :reload, "service[nginx]"
67 nginx_site "tiler.openstreetmap.org" do
68 template "nginx_titiler.conf.erb"
69 variables :aliases => ["tiler.osm.org"]