docker probleme

This commit is contained in:
chk
2026-06-08 21:15:15 +02:00
parent 4358857cf2
commit 094ae5ce68
29 changed files with 4691 additions and 29 deletions

View File

@@ -116,22 +116,13 @@ print(resp.json()["joints"])
## Deployment (Docker / Portainer)
> **Pflichtschritt zuerst:** `config/robot.json` muss als **Datei** existieren, bevor
> der Container startet. Vorlage kopieren und mit der echten Konfiguration füllen:
>
> ```bash
> cp config/robot.json.example config/robot.json
> ```
>
> ⚠️ Fehlt die Datei, legt Docker am Mount-Pfad ein **leeres Verzeichnis** an.
> Der Server startet dann zwar, aber jeder `/v1/estimate` liefert **500**
> (`IsADirectoryError`) und `/v1/config` ebenfalls 500. Genau dann diesen
> Pflichtschritt nachholen und den Container neu starten.
Die `config/robot.json` wird beim Build **mit ins Image gebacken** (`COPY . .`) und
liegt dort fest unter `/app/config/robot.json`. Damit läuft der Container
out-of-the-box — **kein Bind-Mount nötig**, auch nicht als Portainer-Stack.
**Volume** (Pfad muss zur tatsächlichen Datei zeigen, vgl. `docker-compose.yaml`):
```yaml
- ./config/robot.json:/config/robot.json:ro
```
> Voraussetzung: `config/robot.json` muss **zum Build-Zeitpunkt** als Datei
> vorhanden sein. Falls nicht: `cp config/robot.json.example config/robot.json`
> und mit der echten Konfiguration füllen.
**Start & Healthcheck:**
```bash
@@ -139,6 +130,15 @@ docker compose up -d
curl http://<host>:8446/v1/health # {"status":"ok","version":"1.0.0"}
```
**Eigene robot.json ohne Rebuild** (optional): die eingebackene Kopie per Mount
überlagern — siehe auskommentierter `volumes`-Block in `docker-compose.yaml`.
> ⚠️ **Portainer-Falle:** Ein Bind-Mount auf einen Host-Pfad, der **nicht
> existiert**, lässt Docker dort ein leeres **Verzeichnis** anlegen. Die Pipeline
> liest es dann als Datei → `IsADirectoryError` → jeder `/v1/estimate` und
> `/v1/config` antwortet mit **500**. Deshalb ist der Mount jetzt optional;
> aktiviere ihn nur, wenn die Datei am Host-Pfad wirklich liegt.
---
## Konfiguration