Refactor: Reorganize services into standalone structure

This commit is contained in:
2026-01-25 15:19:53 -06:00
parent cf360234c1
commit 10521ee94d
52 changed files with 3253 additions and 11 deletions

View File

@@ -0,0 +1,198 @@
version: '3.8'
networks:
traefik-public:
external: true
media-backend:
driver: bridge
volumes:
homarr_config:
jellyfin_config:
immich_upload:
immich_model_cache:
immich_db:
immich_redis:
services:
homarr:
image: ghcr.io/ajnart/homarr:latest
container_name: homarr
restart: unless-stopped
volumes:
- homarr_config:/app/data
- /var/run/docker.sock:/var/run/docker.sock:ro
environment:
- TZ=America/Chicago
networks:
- traefik-public
- media-backend
labels:
- "traefik.enable=true"
- "traefik.http.routers.homarr.rule=Host(`homarr.sterl.xyz`)"
- "traefik.http.routers.homarr.entrypoints=websecure"
- "traefik.http.routers.homarr.tls.certresolver=cfresolver"
- "traefik.http.services.homarr-svc.loadbalancer.server.port=7575"
- "docktail.enable=true"
- "docktail.name=homarr"
- "docktail.container_port=7575"
jellyfin:
image: jellyfin/jellyfin:latest
container_name: jellyfin
restart: unless-stopped
deploy:
mode: replicated
replicas: 1
placement:
constraints:
- node.hostname == fedora
volumes:
- jellyfin_config:/config
- /mnt/media:/media:ro
environment:
- TZ=America/Chicago
networks:
- traefik-public
- media-backend
labels:
- "traefik.enable=true"
- "traefik.http.routers.jellyfin.rule=Host(`jellyfin.sterl.xyz`)"
- "traefik.http.routers.jellyfin.entrypoints=websecure"
- "traefik.http.routers.jellyfin.tls.certresolver=cfresolver"
- "traefik.http.services.jellyfin-svc.loadbalancer.server.port=8096"
- "docktail.enable=true"
- "docktail.name=jellyfin"
- "docktail.container_port=8096"
immich-server:
image: ghcr.io/immich-app/immich-server:release
container_name: immich-server
restart: unless-stopped
deploy:
mode: replicated
replicas: 1
placement:
constraints:
- node.labels.role == photo
depends_on:
- immich-redis
- immich-db
volumes:
- immich_upload:/usr/src/app/upload
- /mnt/media/Photos:/usr/src/app/upload/library:rw
- /etc/localtime:/etc/localtime:ro
environment:
- DB_HOSTNAME=immich-db
- DB_USERNAME=immich
- DB_PASSWORD=immich
- DB_DATABASE_NAME=immich
- REDIS_HOSTNAME=immich-redis
- TZ=America/Chicago
- IMMICH_MEDIA_LOCATION=/usr/src/app/upload/library
networks:
- traefik-public
- media-backend
labels:
- "traefik.enable=true"
- "traefik.http.routers.immich.rule=Host(`immich.sterl.xyz`)"
- "traefik.http.routers.immich.entrypoints=websecure"
- "traefik.http.routers.immich.tls.certresolver=cfresolver"
- "traefik.http.services.immich-svc.loadbalancer.server.port=2283"
- "docktail.enable=true"
- "docktail.name=immich"
- "docktail.container_port=2283"
- "traefik.http.routers.immich.middlewares=immich-headers"
- "traefik.http.middlewares.immich-headers.headers.customrequestheaders.X-Forwarded-Proto=https"
immich-server-haos:
image: ghcr.io/immich-app/immich-server:release
container_name: immich-server
restart: unless-stopped
deploy:
mode: replicated
replicas: 1
placement:
constraints:
- node.hostname == homeassistant
- node.labels.role == photo
depends_on:
- immich-redis
- immich-db
volumes:
- immich_upload:/usr/src/app/upload
- /mnt/data/supervisor/media/Media/Photos:/usr/src/app/upload/library:rw
- /etc/localtime:/etc/localtime:ro
environment:
- DB_HOSTNAME=immich-db
- DB_USERNAME=immich
- DB_PASSWORD=immich
- DB_DATABASE_NAME=immich
- REDIS_HOSTNAME=immich-redis
- TZ=America/Chicago
- IMMICH_MEDIA_LOCATION=/usr/src/app/upload/library
networks:
- traefik-public
- media-backend
labels:
- "traefik.enable=true"
- "traefik.http.routers.immich.rule=Host(`immich.sterl.xyz`)"
- "traefik.http.routers.immich.entrypoints=websecure"
- "traefik.http.routers.immich.tls.certresolver=cfresolver"
- "traefik.http.services.immich-svc.loadbalancer.server.port=2283"
- "docktail.enable=true"
- "docktail.name=immich"
- "docktail.container_port=2283"
- "traefik.http.routers.immich.middlewares=immich-headers"
- "traefik.http.middlewares.immich-headers.headers.customrequestheaders.X-Forwarded-Proto=https"
immich-machine-learning:
image: ghcr.io/immich-app/immich-machine-learning:release
container_name: immich-machine-learning
restart: unless-stopped
deploy:
mode: replicated
replicas: 1
placement:
constraints:
- node.labels.ai == true
- node.labels.role == photo
volumes:
- immich_model_cache:/cache
environment:
- TZ=America/Chicago
networks:
- media-backend
immich-redis:
image: redis:7-alpine
container_name: immich-redis
restart: unless-stopped
deploy:
mode: replicated
replicas: 1
placement:
constraints:
- node.labels.role == photo
volumes:
- immich_redis:/data
networks:
- media-backend
immich-db:
image: tensorchord/pgvecto-rs:pg14-v0.2.0
container_name: immich-db
restart: unless-stopped
deploy:
mode: replicated
replicas: 1
placement:
constraints:
- node.labels.role == photo
volumes:
- immich_db:/var/lib/postgresql/data
environment:
- POSTGRES_PASSWORD=immich
- POSTGRES_USER=immich
- POSTGRES_DB=immich
networks:
- media-backend