Add ready-to-run copy-paste blocks for server deployment (Teil B)
Documents that Teil A is verified (build tested locally) and provides exact commands for deploy key, docker-compose service, Caddyfile block, and DNS steps so the server-side rollout needs no improvisation. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01T8eccP4XnXFJvpSYMm26as
This commit is contained in:
parent
28ba23102a
commit
e688eaa265
1 changed files with 72 additions and 0 deletions
|
|
@ -203,6 +203,78 @@ cd ~/stack && docker compose build website && docker compose up -d website
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Status
|
||||||
|
|
||||||
|
**Teil A ist erledigt und geprüft:**
|
||||||
|
- `astro.config.mjs` → `site: 'https://larpaso.de'`, statischer Output (Standard, kein Adapter).
|
||||||
|
- `Dockerfile`, `nginx.conf`, `.dockerignore` liegen im Repo, entsprechen exakt der Vorlage oben.
|
||||||
|
- Lokaler `npm run build` läuft fehlerfrei durch (4 statische Seiten, `dist/` wird erzeugt).
|
||||||
|
- Alles committet und nach `https://git.larpaso.de/pascal/larpaso-website` gepusht.
|
||||||
|
|
||||||
|
**Teil B steht noch aus** – das macht Pascal selbst auf dem Server. Fertige Copy-Paste-Blöcke dafür:
|
||||||
|
|
||||||
|
### B1 – Deploy-Key erzeugen (als `deploy` auf dem Server)
|
||||||
|
```bash
|
||||||
|
ssh-keygen -t ed25519 -C "server-deploy@larpaso" -f ~/.ssh/id_ed25519_larpaso-website -N ""
|
||||||
|
cat ~/.ssh/id_ed25519_larpaso-website.pub
|
||||||
|
```
|
||||||
|
Den ausgegebenen Public Key in Forgejo eintragen: `https://git.larpaso.de/pascal/larpaso-website/settings/keys`
|
||||||
|
→ **Deploy-Schlüssel hinzufügen**, einfügen, **schreibgeschützt** lassen.
|
||||||
|
|
||||||
|
### B2 – Repo klonen
|
||||||
|
```bash
|
||||||
|
mkdir -p ~/sites
|
||||||
|
GIT_SSH_COMMAND="ssh -i ~/.ssh/id_ed25519_larpaso-website" \
|
||||||
|
git clone ssh://git@git.larpaso.de:2222/pascal/larpaso-website.git ~/sites/larpaso-website
|
||||||
|
```
|
||||||
|
|
||||||
|
### B3 – Service in `~/stack/docker-compose.yml` ergänzen
|
||||||
|
Unter `services:` einfügen (Einrückung an bestehende Datei anpassen):
|
||||||
|
```yaml
|
||||||
|
website:
|
||||||
|
build:
|
||||||
|
context: /home/deploy/sites/larpaso-website
|
||||||
|
restart: unless-stopped
|
||||||
|
networks: [web]
|
||||||
|
```
|
||||||
|
|
||||||
|
### B4 – Caddy-Block in `~/stack/caddy/Caddyfile` ergänzen
|
||||||
|
```caddyfile
|
||||||
|
larpaso.de {
|
||||||
|
reverse_proxy website:80
|
||||||
|
}
|
||||||
|
|
||||||
|
www.larpaso.de {
|
||||||
|
redir https://larpaso.de{uri} permanent
|
||||||
|
}
|
||||||
|
```
|
||||||
|
(Den `www`-Block nur, wenn auch ein DNS-A-Eintrag für `www` existiert.)
|
||||||
|
|
||||||
|
### B5 – DNS bei IONOS
|
||||||
|
- A-Eintrag `@` → Server-IPv4 (bestehenden `@`-Eintrag ersetzen).
|
||||||
|
- Optional A-Eintrag `www` → Server-IPv4.
|
||||||
|
- Prüfen: `nslookup larpaso.de` muss die Server-IP liefern, bevor B6 läuft.
|
||||||
|
|
||||||
|
### B6 – Bauen & starten
|
||||||
|
```bash
|
||||||
|
cd ~/stack
|
||||||
|
docker compose build website
|
||||||
|
docker compose up -d website
|
||||||
|
docker compose restart caddy
|
||||||
|
docker compose logs -f caddy # auf "certificate obtained successfully" für larpaso.de warten
|
||||||
|
```
|
||||||
|
Danach `https://larpaso.de` im Browser prüfen.
|
||||||
|
|
||||||
|
### B7 – Künftige Updates
|
||||||
|
```bash
|
||||||
|
cd ~/sites/larpaso-website && git pull
|
||||||
|
cd ~/stack && docker compose build website && docker compose up -d website
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
## Sicherheits-Leitplanken (Zusammenfassung)
|
## Sicherheits-Leitplanken (Zusammenfassung)
|
||||||
- Keine Secrets ins Repo/Dockerfile/Logs.
|
- Keine Secrets ins Repo/Dockerfile/Logs.
|
||||||
- Kein zweiter Reverse Proxy, keine Belegung von 80/443 durch den Website-Dienst.
|
- Kein zweiter Reverse Proxy, keine Belegung von 80/443 durch den Website-Dienst.
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue