mirror of
https://github.com/netbox-community/netbox-docker.git
synced 2026-01-28 13:43:13 +00:00
101 lines
2.5 KiB
YAML
101 lines
2.5 KiB
YAML
version: "3.8"
|
|
|
|
services:
|
|
netbox: &netbox
|
|
image: docker.io/netboxcommunity/netbox:${VERSION-v4.4-3.4.1}
|
|
depends_on:
|
|
- postgres
|
|
- redis
|
|
- redis-cache
|
|
env_file: env/netbox.env
|
|
user: "unit:root"
|
|
healthcheck:
|
|
test: curl -f http://localhost:8080/login/ || exit 1
|
|
start_period: 90s
|
|
timeout: 3s
|
|
interval: 15s
|
|
networks:
|
|
qnet-static-bond0-ae19be:
|
|
ipv4_address: 192.168.10.150
|
|
NetBoxNet: {}
|
|
volumes:
|
|
- /share/Container/netbox/configuration:/etc/netbox/config:ro
|
|
- /share/Container/netbox/media:/opt/netbox/netbox/media:rw
|
|
- /share/Container/netbox/reports:/opt/netbox/netbox/reports:rw
|
|
- /share/Container/netbox/scripts:/opt/netbox/netbox/scripts:rw
|
|
|
|
netbox-worker:
|
|
<<: *netbox
|
|
depends_on:
|
|
netbox:
|
|
condition: service_healthy
|
|
command:
|
|
- /opt/netbox/venv/bin/python
|
|
- /opt/netbox/netbox/manage.py
|
|
- rqworker
|
|
networks:
|
|
NetBoxNet: {}
|
|
healthcheck:
|
|
test: ps -aux | grep -v grep | grep -q rqworker || exit 1
|
|
start_period: 20s
|
|
timeout: 3s
|
|
interval: 15s
|
|
|
|
postgres:
|
|
image: docker.io/postgres:17-alpine
|
|
env_file: env/postgres.env
|
|
networks:
|
|
NetBoxNet:
|
|
ipv4_address: 172.31.30.10
|
|
healthcheck:
|
|
test: pg_isready -q -t 2 -d $$POSTGRES_DB -U $$POSTGRES_USER
|
|
start_period: 20s
|
|
timeout: 30s
|
|
interval: 10s
|
|
retries: 5
|
|
volumes:
|
|
- /share/Container/netbox/postgres:/var/lib/postgresql/data
|
|
|
|
redis:
|
|
image: docker.io/valkey/valkey:8.1-alpine
|
|
env_file: env/redis.env
|
|
command:
|
|
- sh
|
|
- -c
|
|
- valkey-server --appendonly yes --requirepass $$REDIS_PASSWORD
|
|
networks:
|
|
NetBoxNet:
|
|
ipv4_address: 172.31.30.11
|
|
healthcheck: &redis-healthcheck
|
|
test: '[ $$(valkey-cli --pass "$${REDIS_PASSWORD}" ping) = ''PONG'' ]'
|
|
start_period: 5s
|
|
timeout: 3s
|
|
interval: 1s
|
|
retries: 5
|
|
volumes:
|
|
- /share/Container/netbox/redis:/data
|
|
|
|
redis-cache:
|
|
image: docker.io/valkey/valkey:8.1-alpine
|
|
env_file: env/redis-cache.env
|
|
command:
|
|
- sh
|
|
- -c
|
|
- valkey-server --requirepass $$REDIS_PASSWORD
|
|
networks:
|
|
NetBoxNet:
|
|
ipv4_address: 172.31.30.12
|
|
healthcheck: *redis-healthcheck
|
|
volumes:
|
|
- /share/Container/netbox/redis-cache:/data
|
|
|
|
networks:
|
|
qnet-static-bond0-ae19be:
|
|
external: true
|
|
|
|
NetBoxNet:
|
|
driver: bridge
|
|
ipam:
|
|
config:
|
|
- subnet: 172.31.30.0/24
|