DevOps i chmura · Automatyzacja
vm-docker
/vm-docker
Wdraża usługi Docker na maszynie wirtualnej z Traefik i Homepage.
- Autor
- htlin222 ↗
- Repozytorium
- dotfiles ↗
- Licencja
- MIT
- Ostatnia zmiana repozytorium
- 10.10.2026
Ocena i bezpieczeństwo
100/ 100Klasa: dobry
Format25 / 25
Frontmatter z nazwą i opisem, poprawna nazwa, opis do 1024 znaków, nazwa zgodna z folderem.
Odkrywalność25 / 25
Opis mówi, kiedy użyć skilla, ma sensowną długość i jest w 3. osobie.
Treść35 / 35
Co najmniej 150 słów i do 500 linii, nagłówki, listy kroków, przykłady albo kod.
Higiena15 / 15
Bez zaślepek typu TODO, bez ścieżek Windows, z licencją.
Ryzykobrak sygnałów w skanie
- Pliki w paczce
- 8
- Skrypty
- 0
- Komentarze HTML
- 0
- Adresy URL w SKILL.md
- 7
Przestarzałość
Brak sygnałów. Repozytorium zmienione 10.10.2026, bez odwołań do wycofanych modeli i API.
Licencja
MIT, otwarta: można używać i zmieniać, z zachowaniem informacji o autorze.
Co robi i kiedy
Wdraża usługi Docker na maszynie wirtualnej z Traefik i Homepage.
Oryginalny opis (EN)
Deploy Docker services on VM with Traefik and Homepage. Use for VM container deploys.
Jak działa
- Overview
- Architecture
- Deploy Checklist
- Validation (MUST DO before writing configs)
- Key Gotchas
- Deep-Dive Docs
- Homepage Groups
Sekcje z nagłówków SKILL.md, w oryginale · 93 linii, 674 słów
Podgląd SKILL.md
---
name: vm-docker
description: Deploy Docker services on VM with Traefik and Homepage. Use for VM container deploys.
---
# Docker on VM with Traefik + Homepage
## Overview
Deploy Docker services on the VM (Pop!\_OS). Web services go behind **Traefik** (port 80) and register on **Homepage** (dashboard at `/`).
- **Access domain**: `vm.local` (mDNS) — use for app `CMD_DOMAIN`/`BASE_URL`, NOT `vm`
- **Network**: `traefik-proxy` (external bridge) — all web containers must join
- **Crane**: `~/go/bin/crane` (NOT on PATH)
- **Compose**: `docker compose` (plugin at `~/.docker/cli-plugins/`). Must `cd` into service dir — `-f` flag broken
## Architecture
```
Port 80 → Traefik ──┬── / → Homepage (dashboard)
├── /hedgedoc → HedgeDoc (:3000) [subpath-aware]
├── /freshrss → FreshRSS (:80)
├── /traefik → Traefik dashboard (api@internal)
└── /<service> → Your new service
Direct ports ───────── :6060 → BookLore [no subpath support]
Config: ~/traefik/traefik.yml — static config
~/traefik/dynamic/<service>.yml — per-service routing
~/homepage/config/services.yaml — dashboard entries
```
## Deploy Checklist
1. **Prepare** — `mkdir -p ~/docker/<service>/{data,config}`
2. **Pull** — `~/go/bin/crane pull <image>:<tag> /tmp/<name>.tar`
3. **Load** — `docker load -i /tmp/<name>.tar`
4. **Compose** — Write `~/docker/<service>/docker-compose.yml` → `cd ~/docker/<service> && docker compose up -d`
5. **Traefik** — Create `~/traefik/dynamic/<service>.yml` (auto-reloads)
6. **Validate before writing configs** — curl-test EVERY URL/route before hardcoding into config files (see Validation section)
7. **Homepage** — Add entry to `~/homepage/config/services.yaml` + group in `settings.yaml`
8. **Verify** — `curl -sI --noproxy '*' http://localhost/<service>`
## Validation (MUST DO before writing configs)
**Always curl-test links before hardcoding them.** Do not assume a route works — prove it.
```bash
# 1. Test container responds directly (find internal IP or use exposed port)
curl -sI --noproxy '*' http://127.0.0.1:<host-port>/
# 2. Test Traefik route works (after writing dynamic config, before Homepage)
curl -sI --noproxy '*' http://127.0.0.1/<service>/
# 3. Test subpath: check HTML AND assets (not just the first response)
curl -s --noproxy '*' http://127.0.0.1/<service>/ | grep -E '<base href|<script src|<link.*href'
# If asset paths are absolute (e.g. /styles.css not ./<service>/styles.css) → subpath won't work
# 4. Test Homepage href URL resolves (the exact URL that will go in services.yaml)
curl -sI --noproxy '*' <href-value>
# 5. Test widget URLs (e.g. Traefik widget)
curl -s --noproxy '*' http://traefik:8080/api/overview
```
**Rule: If curl returns 404, 502, or broken assets → fix FIRST, then write the config.**
## Key Gotchas
| Gotcha | Detail |
| ------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Container name** | Use `http://<container>:<port>` in Traefik config, NOT localhost |
| **Sub-path + stripPrefix** | Need BOTH: `stripPrefix` in Traefik AND app's `BASE_URL`/`CMD_URL_PATH`. Test CSS/JS assets, not just HTML. **BUT** some SPAs (e.g. Booklore) don't support subpath at all — use direct port instead |
| **Subpath compatibility** | Before deploying behind subpath, check if the app supports it. SPAs with hardcoded `<base href="/">` and no `BASE_PATH` config will break. Use direct host port + Homepage `href: http://172.16.252.7:<port>` as fallback |
| **CMD_DOMAIN must match access IP** | For apps like HedgeDoc with `CMD_DOMAIN`, set it to the IP/hostname users actually use (e.g. `172.16.252.7`), NOT `vm.local` if users access via IP |
| **No host ports** | Don't expose ports if Traefik handles routing. Exception: apps without subpath support MUST expose host ports |
| **Traefik dashboard needs 2 routers** | Dashboard at `/traefik` uses `stripPrefix` + `api@internal`. But dashboard JS calls `/api/...` hardcoded — need a second router `PathPrefix(/api)` → `api@internal` (no strip). Without it, API calls fall through to Homepage and dashboard shows empty data. Do NOT use `api.basePath` — it breaks the insecure port API and the Homepage widget |
| **Priority 10** | Set on all routers so Homepage `/` catch-all still works |
| **Auth** | `auth@file` for BasicAuth — omit for public services |
| **Volume paths** | Always absolute: `/home/htlin222/docker/<service>/...` |
## Deep-Dive Docs
| Topic | File |
| ------------------------------------------------ | ------------------- |
| Templates (compose, traefik, homepage, makefile) | @templates.md |
| Troubleshooting | @troubleshooting.md |
| Reference stacks (ready-to-deploy) | `references/*.yml` |
## Homepage Groups
| Group | Current Services |
| -------------- | --------------------------------------------------------- |
| Media | Booklore (direct port :6060, no subpath support) |
| Productivity | HedgeDoc (subpath via Traefik, `CMD_DOMAIN=172.16.252.7`) |
| Infrastructure | Traefik |
Pliki w paczce (8)
- SKILL.md 8 KB
- templates.md 3 KB
- troubleshooting.md 3 KB
- references/booklore.yml 2 KB
- references/freshrss.yml 2 KB
- references/hedgedoc.yml 2 KB
- references/telegram-bot.yml 1 KB
- references/traefik-infra.md 4 KB
Wersje
W bazie nie ma innych skilli o nazwie vm-docker.
Migawka bazy z 13.11.2026 · wersja paczki 1b322fbf1f5a (skrót SHA-256 całej paczki)
Pobrania w ostatnich 30 dniach: 0 · ranking
Zgłoś problem z tym skillem: szkodliwa treść, błędny opis albo prośba autora o usunięcie.
Podobne skille
- 100vps-docker-traefik-deploy
Przygotowuje i obsługuje produkcyjne wdrożenia Docker Compose na VPS z Traefik, DNS, rejestrami obrazów, trwałym storage, kopiami zapasowymi i wycofywaniem zmian. - 100traefik
Obejmuje Traefik v3: providery, entrypointy, routery, middleware, usługi, etykiety Docker, TLS i ACME, dashboard oraz metryki. - 100traefik
Pomaga w pracy z routerem Traefik: konfiguracja dynamiczna, providery Docker i Kubernetes, TLS z Let's Encrypt i middleware, dla dynamicznych reverse proxy i ingressu mikroserwisów. - 100dokploy
Wdraża aplikacje, stosy Docker Compose i bazy danych na własnym serwerze przez Dokploy z Docker Swarm i Traefik, z domenami HTTPS, panelem webowym i API HTTP. - 100traefik
Kieruje ruch i zarządza TLS przez Traefik: reverse proxy dla kontenerów Docker, certyfikaty Let's Encrypt, load balancing, routing po ścieżce lub hoście i middleware. - 100traefik
Wdraża, konfiguruje i diagnozuje Traefik v3 jako reverse proxy: providery, routing, TLS i ACME, middleware i wzorce produkcyjne z przykładami YAML.