infra/databases/docker-compose.yml

82 lines
1.9 KiB
YAML

services:
mongodb:
image: mongo:7
container_name: mongodb
restart: always
command: ["--auth"]
environment:
- MONGO_INITDB_ROOT_USERNAME=${MONGO_ROOT_USER}
- MONGO_INITDB_ROOT_PASSWORD=${MONGO_ROOT_PASS}
ports:
- "27017:27017"
volumes:
- ./mongo-data:/data/db
networks:
- db-net
postgres:
image: postgres:16
container_name: postgres
restart: always
environment:
- POSTGRES_USER=${DB_ROOT_USER}
- POSTGRES_PASSWORD=${DB_ROOT_PASS}
- POSTGRES_DB=postgres
ports:
- "5432:5432"
volumes:
- ./postgres-data:/var/lib/postgresql/data
networks:
- db-net
redis:
image: redis:alpine
container_name: redis
restart: always
command: redis-server --requirepass "${DB_ROOT_PASS}" --save 60 1
ports:
- "6379:6379"
volumes:
- ./redis-data:/data
networks:
- db-net
komodo-periphery:
image: ghcr.io/moghtech/komodo-periphery:2
container_name: komodo-periphery
restart: always
environment:
PERIPHERY_CORE_ADDRESS: ${CORE_IP}:9120
PERIPHERY_CONNECT_AS: Mystic-Databases
PERIPHERY_ONBOARDING_KEY: ${MYSTIC_ONBOARD_KEY}
PERIPHERY_SERVER_ENABLED: "true"
ports:
- "8120:8120"
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- ./komodo:/config
- /proc:/proc:ro
networks:
- db-net
# Exporters updated with new variables
postgres-exporter:
image: prometheuscommunity/postgres-exporter
container_name: postgres-exporter
environment:
- DATA_SOURCE_NAME=postgresql://${DB_ROOT_USER}:${DB_ROOT_PASS}@postgres:5432/postgres?sslmode=disable
networks:
- db-net
redis-exporter:
image: oliver006/redis_exporter:latest
container_name: redis-exporter
environment:
- REDIS_ADDR=redis://redis:6379
- REDIS_PASSWORD=${DB_ROOT_PASS}
networks:
- db-net
networks:
db-net:
driver: bridge