feat: read opening hours from Google Business Profile

Places API script normalizes regular and special hours; build uses a
snapshot, an orari sidecar refreshes /dati/orari.json every 6 hours for
the open-now sign. Adds the company legal name. Key stays in .env.server.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-04 16:13:35 +01:00
co-authored by Claude Opus 5.5
parent 29d8700081
commit a651519dbe
15 changed files with 378 additions and 46 deletions
+8 -2
View File
@@ -8,7 +8,12 @@ Hosting: Docker on the a75 server, same flow as cam85 (`docs/adr/0004-hosting-do
```
It builds locally, builds the amd64 image, loads it on `217.76.62.220`, runs `docker compose up -d` in `/home/ubuntu/officinezuliani` and checks `http://officinezuliani-site:3000/` from the Nginx Proxy Manager container.
Requirements: SSH key access as `root@217.76.62.220`, Docker with buildx, Node/npm.
Requirements: SSH key access as `root@217.76.62.220`, Docker with buildx, Node/npm, and a local `.env.server` (copy `.env.server.example`) with `GOOGLE_PLACES_API_KEY` and `GOOGLE_PLACE_ID`.
## Opening hours from Google (ADR 0005)
- Find the Place ID once: `set -a; source .env.server; set +a; node scripts/orari-google.mjs --cerca "Officine Zuliani Udine"`
- Each deploy refreshes `src/data/orari-google.json` (commit it with the deploy)
- On the server, container `officinezuliani-orari` refreshes `/dati/orari.json` every 6 hours: `docker compose logs orari` shows the last updates
## Publish a hostname (one-time, Nginx Proxy Manager UI)
1. DNS: A record of the hostname → `217.76.62.220`
@@ -25,7 +30,8 @@ docker run --rm -p 8089:3000 officinezuliani-web:latest # http://localhost:808
Check out the previous good commit and run `./deploy.sh` again.
## Server layout
- `/home/ubuntu/officinezuliani/docker-compose.yml` (copied by deploy.sh)
- `/home/ubuntu/officinezuliani/docker-compose.yml`, `scripts/`, `.env` (from `.env.server`, mode 600) — all copied by deploy.sh
- Volume `orari-dati` shared by `orari` (writes) and `web` (`/dati/`, read-only)
- Container `officinezuliani-site` on network `a75`, port 3000, no host ports
## Hostnames