Files
kochwas/docker-compose.prod.yml
Hendrik 32e7e54f4e
Some checks failed
Build & Publish Docker Image / build-and-push (push) Failing after 27s
feat(infra): add Traefik labels and network topology for homelab ingress
- kochwas service gets Traefik v2 labels matching the project's conventions:
  websecure entrypoint, cloudflareResolver, Host(`kochwas.siegeln.net`).
- Service port 3000 exposed to Traefik only; the external port binding is gone.
- Dual network: external 'proxy' (for Traefik ingress) and internal 'internal'
  (for kochwas ↔ searxng). traefik.docker.network hint is set.
- SearXNG has no Traefik labels — intentionally only reachable from kochwas.

Note: the 'proxy' network name must match the existing external Traefik network
(change via 'name:' field if your homelab uses a different one like 'traefik').

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-17 16:05:06 +02:00

50 lines
1.7 KiB
YAML

services:
kochwas:
# Image wird via Gitea Actions gebaut und in die Gitea-Container-Registry gepusht.
# Tag-Override per Umgebungsvariable: KOCHWAS_TAG=sha-abcd1234 docker compose pull
image: gitea.siegeln.net/claude/kochwas:${KOCHWAS_TAG:-latest}
pull_policy: always
volumes:
- ./data:/data
environment:
- DATABASE_PATH=/data/kochwas.db
- IMAGE_DIR=/data/images
- SEARXNG_URL=http://searxng:8080
- NODE_ENV=production
depends_on:
- searxng
restart: unless-stopped
networks:
- proxy
- internal
labels:
- "traefik.enable=true"
# Router for HTTPS traffic
- "traefik.http.routers.kochwas.rule=Host(`kochwas.siegeln.net`)"
- "traefik.http.routers.kochwas.entrypoints=websecure"
- "traefik.http.routers.kochwas.tls.certresolver=cloudflareResolver"
# Specify which port Traefik should forward traffic to inside the container
- "traefik.http.services.kochwas.loadbalancer.server.port=3000"
# Explicitly tell Traefik which network to use (since kochwas is on two networks)
- "traefik.docker.network=proxy"
searxng:
# Absichtlich nur intern erreichbar — keine Traefik-Labels, kein externer Port.
image: searxng/searxng:latest
volumes:
- ./searxng:/etc/searxng
environment:
- BASE_URL=http://searxng:8080/
- INSTANCE_NAME=kochwas-search
restart: unless-stopped
networks:
- internal
networks:
proxy:
# Muss dem Namen des externen Traefik-Netzwerks entsprechen (ggf. in `name:` ändern).
external: true
internal:
# Eigenes internes Netz für kochwas ↔ searxng. Wird von Compose automatisch angelegt.
driver: bridge