feat: deploy in Docker on the a75 server like cam85
Nginx image built locally for amd64 and loaded via docker save/load, compose on the a75 network behind Nginx Proxy Manager (port 3000). Live on officinezuliani.a75.eu with noindex on non-production hosts. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
# ADR 0004: Host the site in Docker on the a75 server, deployed like cam85
|
||||
|
||||
## Status
|
||||
Accepted (2026-11-04) — supersedes the "hosting not decided" note in ADR 0003
|
||||
|
||||
## Context
|
||||
The site is static (ADR 0003). The owner already runs other sites on the VPS `217.76.62.220` (x86_64) with the same pattern as cam85: Docker containers on the shared network `a75`, published through Nginx Proxy Manager (container `nginx-app-1`), images built locally and loaded on the server.
|
||||
|
||||
## Decision
|
||||
- Image: multi-stage `Dockerfile` (Node 22 build → `nginx:1.27-alpine`) serving `dist/` with `docker/nginx.conf` (clean URLs, `.html` → 301, long cache for hashed assets)
|
||||
- `docker-compose.yml`: container `officinezuliani-site`, image `officinezuliani-web:latest`, no published ports, external network `a75`
|
||||
- `deploy.sh` (same flow as cam85): local `npm run build` check → `docker buildx --platform linux/amd64` → `docker save | ssh docker load` → `docker compose up -d` in `/home/ubuntu/officinezuliani`
|
||||
- The container listens on port 3000 (same convention as cam85); the public hostname is a Proxy Host in Nginx Proxy Manager pointing to `officinezuliani-site:3000`, with Let's Encrypt
|
||||
- Test hostname: `https://officinezuliani.a75.eu`. Every host except `officinezulianiudine.it` gets `X-Robots-Tag: noindex, nofollow` so the test copy is not indexed
|
||||
- No `.env` is copied: the site needs none, and the local `.env` holds only the Gitea token
|
||||
|
||||
## Consequences
|
||||
- Deploys need SSH access as root to the server and a local Docker with buildx
|
||||
- No registry: rollback means rebuilding an older commit and redeploying
|
||||
- DNS for the final domain (`officinezulianiudine.it`, today on Italiaonline/Duda) must be moved to the server only at launch; until then a test hostname can be used
|
||||
@@ -2,5 +2,5 @@
|
||||
|
||||
- The Gitea repository (`andrearuffini/officinazuliani` on git.a75.it) is public: no secrets in commits; `.env` stays git-ignored.
|
||||
- Gitea Issues are the task board; no external tracker.
|
||||
- Stack: Astro static (`docs/adr/0003-stack-astro-statico.md`). Hosting and deploy target: not decided yet (record as an ADR).
|
||||
- Stack: Astro static (`docs/adr/0003-stack-astro-statico.md`). Hosting: Docker on the a75 server behind Nginx Proxy Manager (`docs/adr/0004-hosting-docker-server-a75.md`).
|
||||
- Visual direction: proposal 02 "Bottega" (`docs/adr/0002-direzione-visiva-bottega.md`).
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
- `design/assets/sito-attuale/` → images downloaded from the current site
|
||||
- `docs/analisi/`, `docs/progetto/` → audit and development plan
|
||||
- `docs/` (adr, context, runbooks, handoffs), `coordination/`, `.gitea/` → workflow
|
||||
- `Dockerfile`, `docker/nginx.conf`, `docker-compose.yml`, `deploy.sh` → container image and deploy (ADR 0004)
|
||||
- `.claude/launch.json` → preview configs: `sito` (Astro dev, 4321), `proposte` (4173)
|
||||
|
||||
## Important flows
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
# Handoff
|
||||
|
||||
## Issue
|
||||
None (explicit user instruction: deploy like cam85, same server, Docker)
|
||||
|
||||
## Goal
|
||||
Containerize the static site and deploy it on the a75 server with the cam85 flow.
|
||||
|
||||
## Status
|
||||
ready-for-review — live on https://officinezuliani.a75.eu
|
||||
|
||||
## What changed
|
||||
- `Dockerfile` (Node build → nginx), `docker/nginx.conf`, `.dockerignore`, `docker-compose.yml`, `deploy.sh`
|
||||
- ADR 0004, runbook deploy, module map, constraints, CLAUDE.md
|
||||
|
||||
## Files touched
|
||||
- see above
|
||||
|
||||
## Tests
|
||||
- Run: local container on :8089 — all pages 200, `/officina.html` → 301 `/officina`, `/index.html` → 301 `/`, unknown URL 404
|
||||
- Run: `./deploy.sh` → container `officinezuliani-site` up, internal check from `nginx-app-1` HTTP 200
|
||||
- Run: public HTTPS on https://officinezuliani.a75.eu — all pages 200, `.html` → 301, 404 for unknown, `X-Robots-Tag: noindex` present; real-domain Host header gets no noindex
|
||||
|
||||
## Risks / open questions
|
||||
- NPM proxy host forwards to port 3000: container switched to 3000 to match (cam85 convention)
|
||||
- HTTP is not redirected to HTTPS on the test host (NPM "Force SSL" off)
|
||||
- Real domain still points to Italiaonline/Duda: switch only at launch
|
||||
- No custom 404 page yet (nginx default)
|
||||
|
||||
## Suggested next step
|
||||
- Phase 2 content (service pages, FAQ page), contact form decision, custom 404 page
|
||||
+31
-5
@@ -1,7 +1,33 @@
|
||||
# Deploy
|
||||
|
||||
Hosting not decided yet (see `docs/adr/0003-stack-astro-statico.md`). Record the choice as a new ADR, then document here:
|
||||
- Build: `npm run build` → upload `dist/`
|
||||
- Server rule: serve `/<page>` from `/<page>.html` (e.g. nginx `try_files $uri $uri.html $uri/ =404;`)
|
||||
- Keep the current URLs (`/officina`, `/servizi`, `/dove-siamo`, `/contatti`) so no redirects are needed
|
||||
- Rollback procedure: TBD
|
||||
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.
|
||||
|
||||
## Publish a hostname (one-time, Nginx Proxy Manager UI)
|
||||
1. DNS: A record of the hostname → `217.76.62.220`
|
||||
2. NPM → Proxy Hosts → Add: forward hostname `officinezuliani-site`, port `3000`, scheme `http`
|
||||
3. 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` (copied by deploy.sh)
|
||||
- Container `officinezuliani-site` on network `a75`, 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 to `217.76.62.220`, add it to the NPM proxy host with a certificate, and redirect `officinezulianiudine.it` → `www`
|
||||
|
||||
Reference in New Issue
Block a user