add docker build, makefile, and some more shit before we move forward

This commit is contained in:
Jan Novak
2026-02-14 22:18:02 +01:00
committed by kacerr
parent 215b51aadb
commit 5207c48890
11 changed files with 271 additions and 26 deletions

22
build/entrypoint.sh Normal file
View File

@@ -0,0 +1,22 @@
#!/bin/bash
set -euo pipefail
DATA_DIR="/app/data"
# Create symlinks so scripts (which write to /app/) persist data to the volume
for f in byty_sreality.json byty_realingo.json byty_bezrealitky.json \
byty_idnes.json byty_psn.json byty_cityhome.json byty_merged.json \
mapa_bytu.html; do
# Remove real file if it exists (e.g. baked into image)
[ -f "/app/$f" ] && [ ! -L "/app/$f" ] && rm -f "/app/$f"
ln -sf "$DATA_DIR/$f" "/app/$f"
done
echo "[entrypoint] Starting crond..."
crond -b -l 2
echo "[entrypoint] Starting initial scrape in background..."
bash /app/run_all.sh &
echo "[entrypoint] Starting HTTP server on port 8080..."
exec python3 -m http.server 8080 --directory "$DATA_DIR"