Tile-Server-Spike: /tiles StaticFiles-Mount + tiles/ vom Tar/Git ausschließen
- main.py: geschützter /tiles-Mount (TILES_DIR, No-Op ohne Verzeichnis), Range-Requests via Starlette FileResponse - Makefile: tiles/ aus TAR_EXCLUDE (546MB pmtiles nicht ins Staging-Tar) - .gitignore: *.pmtiles/*.osm.pbf/tiles-build ausschließen
This commit is contained in:
parent
cde019cacf
commit
d9ecdb15fb
3 changed files with 14 additions and 0 deletions
6
.gitignore
vendored
6
.gitignore
vendored
|
|
@ -13,3 +13,9 @@ __pycache__/
|
||||||
.claude/worktrees/
|
.claude/worktrees/
|
||||||
Ban Yaro - Google Play package/
|
Ban Yaro - Google Play package/
|
||||||
/unsplash/
|
/unsplash/
|
||||||
|
|
||||||
|
# Selbst-gehostete Vektor-Tiles (groß, gehören nicht ins Repo)
|
||||||
|
tiles/build/
|
||||||
|
*.pmtiles
|
||||||
|
*.osm.pbf
|
||||||
|
*.mbtiles
|
||||||
|
|
|
||||||
1
Makefile
1
Makefile
|
|
@ -24,6 +24,7 @@ TAR_EXCLUDE := --exclude='.git' \
|
||||||
--exclude='./backend/__pycache__' \
|
--exclude='./backend/__pycache__' \
|
||||||
--exclude='./.env' \
|
--exclude='./.env' \
|
||||||
--exclude='./*.db' \
|
--exclude='./*.db' \
|
||||||
|
--exclude='./tiles' \
|
||||||
--exclude='./.DS_Store'
|
--exclude='./.DS_Store'
|
||||||
|
|
||||||
.PHONY: help deploy deploy-clean staging release sync push restart build stop status \
|
.PHONY: help deploy deploy-clean staging release sync push restart build stop status \
|
||||||
|
|
|
||||||
|
|
@ -371,6 +371,13 @@ app.mount("/js", StaticFiles(directory=f"{STATIC_DIR}/js"), name="js")
|
||||||
app.mount("/icons", StaticFiles(directory=f"{STATIC_DIR}/icons"), name="icons")
|
app.mount("/icons", StaticFiles(directory=f"{STATIC_DIR}/icons"), name="icons")
|
||||||
app.mount("/img", StaticFiles(directory=f"{STATIC_DIR}/img"), name="img")
|
app.mount("/img", StaticFiles(directory=f"{STATIC_DIR}/img"), name="img")
|
||||||
|
|
||||||
|
# Selbst-gehostete Vektor-Tiles (.pmtiles) — liegen im data-Volume, NICHT im Image.
|
||||||
|
# Starlette FileResponse beherrscht Range-Requests (206) → MapLibre/pmtiles-Protokoll.
|
||||||
|
# Guard: Mount nur wenn das Verzeichnis existiert (sonst No-Op, z. B. lokal/Prod ohne Tiles).
|
||||||
|
_TILES_DIR = os.getenv("TILES_DIR", "/data/tiles")
|
||||||
|
if os.path.isdir(_TILES_DIR):
|
||||||
|
app.mount("/tiles", StaticFiles(directory=_TILES_DIR), name="tiles")
|
||||||
|
|
||||||
# User-generierte Medien (Fotos aus Tagebuch, Giftköder-Alarm, etc.)
|
# User-generierte Medien (Fotos aus Tagebuch, Giftköder-Alarm, etc.)
|
||||||
MEDIA_DIR = os.getenv("MEDIA_DIR", "/data/media")
|
MEDIA_DIR = os.getenv("MEDIA_DIR", "/data/media")
|
||||||
os.makedirs(MEDIA_DIR, exist_ok=True)
|
os.makedirs(MEDIA_DIR, exist_ok=True)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue