This commit restructures the homeserver repository to isolate the core gateway and management tools (Control Plane) from user applications (Data Plane). This allows applications to have independent lifecycles and CI/CD pipelines, preventing git history contamination.
- Relocated user applications (excalidraw, gitea, jellyfin, learning-hub, mermaid, ollama) to an external deployments directory.
- Moved homepage to the root directory as a core server component and removed the empty apps directory.
- Streamlined up.sh and down.sh to deploy and stop only core services and homepage, removing --infra-only parameters.
- Replaced all hardcoded domain names with a configurable global DOMAIN environment variable in docker-compose files.
- Used Authelia templating ({{ env "DOMAIN" }}) in configuration.yml to dynamically resolve SSO cookie domains and redirection URLs.
- Updated up.sh and down.sh helpers to explicitly pass env files via --env-file flags, resolving compose interpolation warnings.
- Created a declarative NixOS module (infra/nixos/dynu-ddns.nix) to orchestrate the Dynu DDNS update script.
- Created Authelia .env-example template for setup reproducibility.
- Refactored .gitignore to exclude obsolete app cache rules and keep it minimal to core secrets, volumes, and logs.
- Updated documentation (README, architecture, roadmap, usability) to document decoupled deployments and public/SSO service templates.
104 lines
3.7 KiB
YAML
104 lines
3.7 KiB
YAML
services:
|
|
socket-proxy:
|
|
image: tecnativa/docker-socket-proxy
|
|
container_name: socket-proxy
|
|
restart: always
|
|
volumes:
|
|
- /var/run/docker.sock:/var/run/docker.sock:ro # Only place the real socket is mounted
|
|
environment:
|
|
- CONTAINERS=1 # Traefik needs to see containers
|
|
- NETWORKS=1 # Traefik needs to see networks
|
|
- SERVICES=1
|
|
- TASKS=1
|
|
- IMAGES=1 # Needed for Watchtower/Portainer
|
|
- VOLUMES=1 # Needed for Portainer
|
|
- POST=1 # Needed for Portainer/Watchtower to start/stop/create containers
|
|
- DELETE=1 # Needed for Portainer/Watchtower to remove containers/images
|
|
- DOCKER_API_VERSION=1.40
|
|
- VERSION=1 # Allow Traefik to query version
|
|
- INFO=1 # Allow Traefik to query info
|
|
- EVENTS=1 # Allow Traefik to monitor container changes
|
|
- PING=1 # Allow Traefik to check Docker health
|
|
- BUILD=0
|
|
- COMMIT=0
|
|
- CONFIGS=0
|
|
- DISTRIBUTION=0
|
|
- EXEC=0
|
|
- NODES=0
|
|
- PLUGINS=0
|
|
- SECRETS=0
|
|
- SWARM=0
|
|
- SYSTEM=0
|
|
networks:
|
|
- socket-net
|
|
|
|
traefik:
|
|
image: traefik:v3.6
|
|
container_name: traefik
|
|
restart: always
|
|
depends_on:
|
|
- socket-proxy
|
|
ports:
|
|
- "80:80"
|
|
- "443:443"
|
|
environment:
|
|
- DYNU_API_KEY=${DYNU_API_KEY}
|
|
- DOCKER_API_VERSION=1.40
|
|
command:
|
|
- "--log.level=INFO"
|
|
- "--api.dashboard=true"
|
|
- "--providers.docker=true"
|
|
- "--providers.docker.endpoint=tcp://socket-proxy:2375"
|
|
- "--providers.docker.exposedByDefault=false"
|
|
- "--entrypoints.web.address=:80"
|
|
- "--entrypoints.websecure.address=:443"
|
|
# Global TLS defaults for websecure
|
|
- "--entrypoints.websecure.http.tls.certResolver=myresolver"
|
|
- "--entrypoints.websecure.http.tls.domains[0].main=${DOMAIN}"
|
|
- "--entrypoints.websecure.http.tls.domains[0].sans=*.${DOMAIN}"
|
|
# SSL Setup
|
|
- "--certificatesresolvers.myresolver.acme.dnschallenge=true"
|
|
- "--certificatesresolvers.myresolver.acme.dnschallenge.provider=dynu"
|
|
- "--certificatesresolvers.myresolver.acme.email=${ACME_EMAIL}"
|
|
- "--certificatesresolvers.myresolver.acme.storage=/letsencrypt/acme.json"
|
|
volumes:
|
|
- ./letsencrypt:/letsencrypt
|
|
networks:
|
|
- socket-net
|
|
- proxy-net
|
|
labels:
|
|
- "traefik.enable=true"
|
|
|
|
# Middleware: Redirect to HTTPS
|
|
- "traefik.http.middlewares.https-redirect.redirectscheme.scheme=https"
|
|
- "traefik.http.middlewares.https-redirect.redirectscheme.permanent=true"
|
|
|
|
# Middleware: Authelia Guard
|
|
- "traefik.http.middlewares.authelia-auth.forwardauth.address=http://authelia:9091/api/verify?rd=https://auth.${DOMAIN}/"
|
|
- "traefik.http.middlewares.authelia-auth.forwardauth.trustForwardHeader=true"
|
|
- "traefik.http.middlewares.authelia-auth.forwardauth.authResponseHeaders=Remote-User,Remote-Groups,Remote-Name,Remote-Email"
|
|
|
|
# Dashboard - Public (HTTPS)
|
|
- "traefik.http.routers.traefik-dash.rule=Host(`traefik.${DOMAIN}`)"
|
|
- "traefik.http.routers.traefik-dash.entrypoints=websecure"
|
|
- "traefik.http.routers.traefik-dash.tls=true"
|
|
- "traefik.http.routers.traefik-dash.service=api@internal"
|
|
- "traefik.http.routers.traefik-dash.middlewares=authelia-auth@docker"
|
|
|
|
# Dashboard - Public (Redirect)
|
|
- "traefik.http.routers.traefik-dash-red.rule=Host(`traefik.${DOMAIN}`)"
|
|
- "traefik.http.routers.traefik-dash-red.entrypoints=web"
|
|
- "traefik.http.routers.traefik-dash-red.middlewares=https-redirect@docker"
|
|
|
|
logging:
|
|
driver: "json-file"
|
|
options:
|
|
max-size: "10m"
|
|
max-file: "3"
|
|
|
|
networks:
|
|
socket-net:
|
|
external: true
|
|
proxy-net:
|
|
external: true
|