Initial commit: homelab configuration and documentation
This commit is contained in:
170
services/swarm/stacks/infrastructure.yml
Normal file
170
services/swarm/stacks/infrastructure.yml
Normal file
@@ -0,0 +1,170 @@
|
||||
version: '3.8'
|
||||
|
||||
networks:
|
||||
traefik-public:
|
||||
external: true
|
||||
homelab-backend:
|
||||
driver: overlay
|
||||
|
||||
volumes:
|
||||
tsdproxy_config:
|
||||
tsdproxy_data:
|
||||
komodo_data:
|
||||
komodo_mongo_data:
|
||||
|
||||
services:
|
||||
komodo-mongo:
|
||||
image: mongo:7
|
||||
volumes:
|
||||
- komodo_mongo_data:/data/db
|
||||
networks:
|
||||
- homelab-backend
|
||||
deploy:
|
||||
placement:
|
||||
constraints:
|
||||
- node.labels.leader == true
|
||||
resources:
|
||||
limits:
|
||||
memory: 512M
|
||||
cpus: '1.0'
|
||||
reservations:
|
||||
memory: 128M
|
||||
cpus: '0.1'
|
||||
restart_policy:
|
||||
condition: on-failure
|
||||
delay: 5s
|
||||
max_attempts: 3
|
||||
logging:
|
||||
driver: "json-file"
|
||||
options:
|
||||
max-size: "10m"
|
||||
max-file: "3"
|
||||
|
||||
komodo-core:
|
||||
image: ghcr.io/moghtech/komodo:latest
|
||||
depends_on:
|
||||
- komodo-mongo
|
||||
environment:
|
||||
- KOMODO_DATABASE_ADDRESS=komodo-mongo:27017
|
||||
volumes:
|
||||
- komodo_data:/config
|
||||
networks:
|
||||
- traefik-public
|
||||
- homelab-backend
|
||||
deploy:
|
||||
placement:
|
||||
constraints:
|
||||
- node.labels.leader == true
|
||||
resources:
|
||||
limits:
|
||||
memory: 512M
|
||||
cpus: '1.0'
|
||||
reservations:
|
||||
memory: 128M
|
||||
cpus: '0.1'
|
||||
restart_policy:
|
||||
condition: on-failure
|
||||
delay: 5s
|
||||
max_attempts: 3
|
||||
labels:
|
||||
- "traefik.enable=true"
|
||||
- "traefik.http.routers.komodo.rule=Host(`komodo.sj98.duckdns.org`)"
|
||||
- "traefik.http.routers.komodo.entrypoints=websecure"
|
||||
- "traefik.http.routers.komodo.tls.certresolver=leresolver"
|
||||
- "traefik.http.services.komodo.loadbalancer.server.port=9120"
|
||||
- "traefik.docker.network=traefik-public"
|
||||
- "tsdproxy.enable=true"
|
||||
- "tsdproxy.name=komodo"
|
||||
logging:
|
||||
driver: "json-file"
|
||||
options:
|
||||
max-size: "10m"
|
||||
max-file: "3"
|
||||
|
||||
komodo-periphery:
|
||||
image: ghcr.io/moghtech/komodo-periphery:latest
|
||||
environment:
|
||||
- PERIPHERY_Id=periphery-{{.Node.Hostname}}
|
||||
volumes:
|
||||
- /var/run/docker.sock:/var/run/docker.sock:ro
|
||||
deploy:
|
||||
mode: global
|
||||
resources:
|
||||
limits:
|
||||
memory: 128M
|
||||
cpus: '0.5'
|
||||
reservations:
|
||||
memory: 32M
|
||||
cpus: '0.05'
|
||||
restart_policy:
|
||||
condition: on-failure
|
||||
delay: 5s
|
||||
max_attempts: 3
|
||||
logging:
|
||||
driver: "json-file"
|
||||
options:
|
||||
max-size: "10m"
|
||||
max-file: "3"
|
||||
|
||||
watchtower:
|
||||
image: containrrr/watchtower:1.7.1
|
||||
volumes:
|
||||
- /var/run/docker.sock:/var/run/docker.sock
|
||||
environment:
|
||||
- DOCKER_API_VERSION=1.44
|
||||
command: --cleanup --interval 86400
|
||||
deploy:
|
||||
placement:
|
||||
constraints:
|
||||
- node.role == manager
|
||||
resources:
|
||||
limits:
|
||||
memory: 256M
|
||||
cpus: '0.25'
|
||||
reservations:
|
||||
memory: 64M
|
||||
cpus: '0.05'
|
||||
restart_policy:
|
||||
condition: on-failure
|
||||
delay: 5s
|
||||
max_attempts: 3
|
||||
logging:
|
||||
driver: "json-file"
|
||||
options:
|
||||
max-size: "10m"
|
||||
max-file: "3"
|
||||
|
||||
tsdproxy:
|
||||
image: almeidapaulopt/tsdproxy:v0.5.1
|
||||
networks:
|
||||
- traefik-public
|
||||
volumes:
|
||||
- /var/run/docker.sock:/var/run/docker.sock:ro
|
||||
- tsdproxy_config:/config
|
||||
- tsdproxy_data:/data
|
||||
deploy:
|
||||
resources:
|
||||
limits:
|
||||
memory: 256M
|
||||
cpus: '0.25'
|
||||
reservations:
|
||||
memory: 64M
|
||||
cpus: '0.05'
|
||||
restart_policy:
|
||||
condition: on-failure
|
||||
delay: 5s
|
||||
max_attempts: 3
|
||||
labels:
|
||||
- "traefik.enable=true"
|
||||
- "traefik.http.routers.tsdproxy.rule=Host(`tsdproxy.sj98.duckdns.org`)"
|
||||
- "traefik.http.routers.tsdproxy.entrypoints=websecure"
|
||||
- "traefik.http.routers.tsdproxy.tls.certresolver=leresolver"
|
||||
- "traefik.http.services.tsdproxy.loadbalancer.server.port=8080"
|
||||
- "traefik.docker.network=traefik-public"
|
||||
- "tsdproxy.enable=true"
|
||||
- "tsdproxy.name=tsdproxy"
|
||||
logging:
|
||||
driver: "json-file"
|
||||
options:
|
||||
max-size: "10m"
|
||||
max-file: "3"
|
||||
Reference in New Issue
Block a user