Files
public/automation/automation-vm/NetBox/docker-compose.yaml
T
thesabear c05c7164c8 Restructure into one folder per private repo/host, not a flat Docker/ dump
rocky-docker-lxc/, caddy-vm/, monitoring-vm/ (was missing entirely -
Grafana+Loki+Prometheus stack, refreshed and CA mount stripped same as
everything else), and automation/{ansible,automation-vm,iac}/ for the
three repos that live on the automation VM. Hawser is genuinely
deployed on all three of caddy-vm/monitoring-vm/automation-vm so it's
duplicated in each rather than picking one canonical home.

Old Ansible/ and "Infrastrucutre as Code/" content moved under
automation/ansible/old-playbooks and automation/iac/old-content as-is
for now - contents still need refreshing against the current repos and
a per-folder README, that's the next pass.
2026-07-06 02:41:53 +03:00

113 lines
2.9 KiB
YAML

services:
postgres:
image: postgres:17-alpine
container_name: netbox-postgres
restart: unless-stopped
environment:
POSTGRES_DB: ${POSTGRES_DB}
POSTGRES_USER: ${POSTGRES_USER}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
volumes:
- /path/to/netbox/postgres_data:/var/lib/postgresql/data
healthcheck:
test: pg_isready -q -t 2 -d $$POSTGRES_DB -U $$POSTGRES_USER
start_period: 20s
timeout: 30s
interval: 10s
retries: 5
networks:
- netbox-net
redis:
image: valkey/valkey:9.0-alpine
container_name: netbox-redis
restart: unless-stopped
command:
- sh
- -c
- valkey-server --appendonly yes --requirepass $$REDIS_PASSWORD
environment:
REDIS_PASSWORD: ${REDIS_PASSWORD}
volumes:
- /path/to/netbox/redis_data:/data
networks:
- netbox-net
redis-cache:
image: valkey/valkey:9.0-alpine
container_name: netbox-redis-cache
restart: unless-stopped
command:
- sh
- -c
- valkey-server --requirepass $$REDIS_PASSWORD
environment:
REDIS_PASSWORD: ${REDIS_CACHE_PASSWORD}
volumes:
- /path/to/netbox/redis_cache:/data
networks:
- netbox-net
netbox: &netbox
image: netboxcommunity/netbox:latest
container_name: netbox
user: "netbox:root"
restart: unless-stopped
depends_on:
- postgres
- redis
- redis-cache
env_file: .env
ports:
- ${HTTP_PORT}:8080
environment:
SECRET_KEY: ${NETBOX_SECRET_KEY}
DB_NAME: ${POSTGRES_DB}
DB_USER: ${POSTGRES_USER}
DB_PASSWORD: ${POSTGRES_PASSWORD}
DB_HOST: postgres
REDIS_HOST: redis
REDIS_PORT: 6379
REDIS_PASSWORD: ${REDIS_PASSWORD}
REDIS_DATABASE: 0
REDIS_CACHE_HOST: redis-cache
REDIS_CACHE_PORT: 6379
REDIS_CACHE_PASSWORD: ${REDIS_CACHE_PASSWORD}
REDIS_CACHE_DATABASE: 1
SUPERUSER_NAME: ${SUPERUSER_NAME}
SUPERUSER_PASSWORD: ${SUPERUSER_PASSWORD}
SUPERUSER_EMAIL: ${SUPERUSER_EMAIL}
volumes:
- /path/to/netbox/netbox_media:/opt/netbox/netbox/media
- /path/to/netbox/netbox_reports:/opt/netbox/netbox/reports
- /path/to/netbox/netbox_scripts:/opt/netbox/netbox/scripts
- ./configuration/extra.py:/etc/netbox/config/extra.py:ro
healthcheck:
test: curl -f http://localhost:8080/login/ || exit 1
start_period: 90s
timeout: 3s
interval: 15s
networks:
- netbox-net
netbox-worker:
<<: *netbox
container_name: netbox-worker
ports: []
depends_on:
netbox:
condition: service_healthy
command:
- /opt/netbox/venv/bin/python
- /opt/netbox/netbox/manage.py
- rqworker
healthcheck:
test: ps -aux | grep -v grep | grep -q rqworker || exit 1
start_period: 20s
timeout: 3s
interval: 15s
networks:
netbox-net:
external: true