2.1 KiB
2.1 KiB
Deploy
Hosting: Docker on the a75 server, same flow as cam85 (docs/adr/0004-hosting-docker-server-a75.md).
Deploy
./deploy.sh
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, 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-orarirefreshes/dati/orari.jsonevery 24 hours:docker compose logs orarishows the last updates
Publish a hostname (one-time, Nginx Proxy Manager UI)
- DNS: A record of the hostname →
217.76.62.220 - NPM → Proxy Hosts → Add: forward hostname
officinezuliani-site, port3000, schemehttp - SSL tab: request a Let's Encrypt certificate, force SSL
Test the image locally
docker buildx build --platform linux/amd64 -t officinezuliani-web:latest --load .
docker run --rm -p 8089:3000 officinezuliani-web:latest # http://localhost:8089
Rollback
Check out the previous good commit and run ./deploy.sh again.
Server layout
/home/ubuntu/officinezuliani/docker-compose.yml,scripts/,.env(from.env.server, mode 600) — all copied by deploy.sh- Volume
orari-datishared byorari(writes) andweb(/dati/, read-only) - Container
officinezuliani-siteon networka75, port 3000, no host ports
Hostnames
- Test: https://officinezuliani.a75.eu (NPM proxy host #35, Let's Encrypt) — served with
noindex - Production:
www.officinezulianiudine.it— still on Italiaonline/Duda; at launch point DNS to217.76.62.220, add it to the NPM proxy host with a certificate, and redirectofficinezulianiudine.it→www