-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feature(caddy-pmtiles): add Caddyfile
- Loading branch information
1 parent
f10675d
commit ceabfcf
Showing
3 changed files
with
46 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
{ | ||
# to use handle_path for prefixes, pmtiles_proxy must have a defined | ||
# position in the ordering of handlers. | ||
order pmtiles_proxy before reverse_proxy | ||
email ${MAPS_EMAIL} | ||
} | ||
|
||
${MAPS_DOMAIN} { | ||
handle_path /tiles/* { | ||
pmtiles_proxy { | ||
bucket ${MAPS_PMTILES_LOCATION} | ||
cache_size 19000 | ||
# used to embed a tiles URL in TileJSON. | ||
public_url https://${MAPS_DOMAIN}/tiles | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#!/bin/sh | ||
set -e | ||
|
||
# Debug: print environment variables | ||
echo "Environment variables:" | ||
echo "MAPS_DOMAIN=${MAPS_DOMAIN}" | ||
echo "MAPS_PMTILES_LOCATION=${MAPS_PMTILES_LOCATION}" | ||
echo "MAPS_EMAIL=${MAPS_EMAIL}" | ||
|
||
# Replace environment variables in Caddyfile | ||
export MAPS_DOMAIN | ||
export MAPS_PMTILES_LOCATION | ||
export MAPS_EMAIL | ||
envsubst '${MAPS_DOMAIN} ${MAPS_PMTILES_LOCATION} ${MAPS_EMAIL}' < /etc/caddy/Caddyfile.template > /etc/caddy/Caddyfile | ||
|
||
echo "Caddyfile:" | ||
cat /etc/caddy/Caddyfile | ||
|
||
# Execute Caddy | ||
exec /usr/bin/caddy run --config /etc/caddy/Caddyfile |