infra/databases/docker-compose.yml
2026-03-28 13:22:12 -04:00

102 lines
2.4 KiB
YAML

services:
# --- MONGODB ---
mongodb:
image: mongo:7
container_name: mongodb
restart: always
ports:
- "27017:27017"
volumes:
- ./mongo-data:/data/db
networks:
- db-net
# --- POSTGRESQL ---
postgres:
image: postgres:16
container_name: postgres
restart: always
environment:
- POSTGRES_USER=mystic_admin
- POSTGRES_PASSWORD=Nyhjew-didvot-zypsa7
- POSTGRES_DB=postgres
ports:
- "5432:5432"
volumes:
- ./postgres-data:/var/lib/postgresql/data
networks:
- db-net
# --- KOMODO AGENT (PERIPHERY) ---
komodo-periphery:
image: ghcr.io/moghtech/komodo-periphery:2
container_name: komodo-periphery
restart: always
environment:
# The Tailscale IP of VM1 (The Brain)
PERIPHERY_CORE_ADDRESS: 100.80.179.128:9120
# The name that will appear in your Komodo Web UI
PERIPHERY_CONNECT_AS: Mystic-Databases
# Your Onboarding Key from the UI
PERIPHERY_ONBOARDING_KEY: O_dPWwdaJNO7q87kgvPE4hnjaLlcsu_O
PERIPHERY_SERVER_ENABLED: "true"
# Recommended for correct disk reporting
PERIPHERY_INCLUDE_DISK_MOUNTS: /etc/hostname
ports:
- "8120:8120"
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- ./komodo:/config
- /proc:/proc:ro
networks:
- db-net
# --- MONITORING EXPORTERS (Scraped by VM1) ---
node-exporter:
image: prom/node-exporter:latest
container_name: node-exporter
restart: always
ports:
- "9100:9100"
networks:
- db-net
cadvisor:
image: gcr.io/cadvisor/cadvisor:latest
container_name: cadvisor
restart: always
ports:
- "8080:8080"
volumes:
- /:/rootfs:ro
- /var/run:/var/run:ro
- /sys:/sys:ro
- /var/lib/docker/:/var/lib/docker:ro
networks:
- db-net
postgres-exporter:
image: prometheuscommunity/postgres-exporter
container_name: postgres-exporter
restart: always
environment:
- DATA_SOURCE_NAME=postgresql://mystic_admin:your_secure_password@postgres:5432/postgres?sslmode=disable
ports:
- "9187:9187"
networks:
- db-net
mongodb-exporter:
image: percona/mongodb_exporter:0.40
container_name: mongodb-exporter
restart: always
command:
- '--mongodb.uri=mongodb://mongodb:27017'
ports:
- "9216:9216"
networks:
- db-net
networks:
db-net:
driver: bridge