Docker-Deployment fuer nuccy
- Dockerfile (Next.js standalone, Multi-Stage) + .dockerignore - deploy.sh fuer strom-next angepasst (Registry docker.citysensor.de, multiplatform build & push) - docker-compose.prod.yml: Netzwerk 'smarthome' (external), InfluxDB als Host 'influx', alle Env-Defaults gesetzt, INFLUX_TOKEN aus .env - .env.production.example (nur Token/Port), public/ fuer den Image-Build - README: Deploy-Anleitung Lokal verifiziert: Image baut, Container startet und liefert HTTP 200. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -101,10 +101,48 @@ curl -s -XPOST "http://nuccy:8086/api/v2/query?org=citysensor" \
|
||||
schema.fieldKeys(bucket: "strom", predicate: (r) => r._measurement == "arbeit")'
|
||||
```
|
||||
|
||||
## Starten
|
||||
## Starten (lokal)
|
||||
|
||||
```bash
|
||||
npm run dev # http://localhost:3000
|
||||
npm run build # Produktionsbuild
|
||||
npm start
|
||||
```
|
||||
|
||||
## Docker / Deployment auf nuccy
|
||||
|
||||
Die App läuft als Container auf **nuccy** im externen Docker-Netzwerk
|
||||
**`smarthome`** und erreicht die InfluxDB dort unter dem Host **`influx`**
|
||||
(`http://influx:8086`).
|
||||
|
||||
### Image bauen & in die Registry pushen (vom Entwicklungsrechner)
|
||||
|
||||
```bash
|
||||
./deploy.sh # Tag latest
|
||||
./deploy.sh v1.2.0 # eigener Tag
|
||||
```
|
||||
|
||||
Baut multiplattform (amd64/arm64) und pusht nach
|
||||
`docker.citysensor.de/strom-next:<tag>`.
|
||||
|
||||
### Auf nuccy starten
|
||||
|
||||
`docker-compose.prod.yml` neben eine `.env` legen (aus
|
||||
`.env.production.example`) und das **InfluxDB-Read-Token** dort eintragen:
|
||||
|
||||
```bash
|
||||
# .env
|
||||
INFLUX_TOKEN=...
|
||||
# optional: STROM_PORT=3000
|
||||
```
|
||||
|
||||
Dann:
|
||||
|
||||
```bash
|
||||
docker compose -f docker-compose.prod.yml pull
|
||||
docker compose -f docker-compose.prod.yml up -d
|
||||
```
|
||||
|
||||
Die App ist anschließend auf nuccy unter Port `3000` (bzw. `STROM_PORT`)
|
||||
erreichbar. Alle InfluxDB-/Lade-Einstellungen sind in `docker-compose.prod.yml`
|
||||
gesetzt; nur das Token kommt aus der `.env`.
|
||||
|
||||
Reference in New Issue
Block a user