feat: add docker-compose for Netbox with Tailscale
This commit is contained in:
102
docker-compose.yml
Normal file
102
docker-compose.yml
Normal file
@@ -0,0 +1,102 @@
|
|||||||
|
services:
|
||||||
|
tailscale:
|
||||||
|
image: tailscale/tailscale:latest
|
||||||
|
container_name: netbox-tailscale
|
||||||
|
hostname: netbox
|
||||||
|
environment:
|
||||||
|
- TS_AUTHKEY=${TS_AUTHKEY}
|
||||||
|
- TS_STATE_DIR=/var/lib/tailscale
|
||||||
|
- TS_SERVE_CONFIG=/config/serve-config.json
|
||||||
|
volumes:
|
||||||
|
- tailscale-state:/var/lib/tailscale
|
||||||
|
- ./serve-config.json:/config/serve-config.json:ro
|
||||||
|
cap_add:
|
||||||
|
- NET_ADMIN
|
||||||
|
- SYS_MODULE
|
||||||
|
restart: unless-stopped
|
||||||
|
|
||||||
|
redis:
|
||||||
|
image: redis:7-alpine
|
||||||
|
container_name: netbox-redis
|
||||||
|
command: redis-server --appendonly yes
|
||||||
|
volumes:
|
||||||
|
- redis-data:/data
|
||||||
|
restart: unless-stopped
|
||||||
|
healthcheck:
|
||||||
|
test: ["CMD", "redis-cli", "ping"]
|
||||||
|
interval: 10s
|
||||||
|
timeout: 5s
|
||||||
|
retries: 3
|
||||||
|
|
||||||
|
netbox:
|
||||||
|
image: gitea.arnodo.fr/damien/netbox:v4.4
|
||||||
|
container_name: netbox
|
||||||
|
network_mode: service:tailscale
|
||||||
|
depends_on:
|
||||||
|
tailscale:
|
||||||
|
condition: service_started
|
||||||
|
redis:
|
||||||
|
condition: service_healthy
|
||||||
|
environment:
|
||||||
|
- DB_HOST=postgresql.taila5ad8.ts.net
|
||||||
|
- DB_PORT=5432
|
||||||
|
- DB_NAME=netbox
|
||||||
|
- DB_USER=netbox
|
||||||
|
- DB_PASSWORD=${DB_PASSWORD}
|
||||||
|
- REDIS_HOST=redis
|
||||||
|
- REDIS_PORT=6379
|
||||||
|
- SECRET_KEY=${SECRET_KEY}
|
||||||
|
- SUPERUSER_NAME=${SUPERUSER_NAME}
|
||||||
|
- SUPERUSER_EMAIL=${SUPERUSER_EMAIL}
|
||||||
|
- SUPERUSER_PASSWORD=${SUPERUSER_PASSWORD}
|
||||||
|
- SKIP_SUPERUSER=${SKIP_SUPERUSER:-false}
|
||||||
|
volumes:
|
||||||
|
- netbox-media:/opt/netbox/netbox/media
|
||||||
|
- netbox-reports:/opt/netbox/netbox/reports
|
||||||
|
- netbox-scripts:/opt/netbox/netbox/scripts
|
||||||
|
restart: unless-stopped
|
||||||
|
|
||||||
|
netbox-worker:
|
||||||
|
image: gitea.arnodo.fr/damien/netbox:v4.4
|
||||||
|
container_name: netbox-worker
|
||||||
|
depends_on:
|
||||||
|
- netbox
|
||||||
|
command: /opt/netbox/venv/bin/python /opt/netbox/netbox/manage.py rqworker high default low
|
||||||
|
environment:
|
||||||
|
- DB_HOST=postgresql.taila5ad8.ts.net
|
||||||
|
- DB_PORT=5432
|
||||||
|
- DB_NAME=netbox
|
||||||
|
- DB_USER=netbox
|
||||||
|
- DB_PASSWORD=${DB_PASSWORD}
|
||||||
|
- REDIS_HOST=redis
|
||||||
|
- REDIS_PORT=6379
|
||||||
|
- SECRET_KEY=${SECRET_KEY}
|
||||||
|
volumes:
|
||||||
|
- netbox-media:/opt/netbox/netbox/media
|
||||||
|
- netbox-reports:/opt/netbox/netbox/reports
|
||||||
|
- netbox-scripts:/opt/netbox/netbox/scripts
|
||||||
|
restart: unless-stopped
|
||||||
|
|
||||||
|
netbox-housekeeping:
|
||||||
|
image: gitea.arnodo.fr/damien/netbox:v4.4
|
||||||
|
container_name: netbox-housekeeping
|
||||||
|
depends_on:
|
||||||
|
- netbox
|
||||||
|
command: /opt/netbox/housekeeping.sh
|
||||||
|
environment:
|
||||||
|
- DB_HOST=postgresql.taila5ad8.ts.net
|
||||||
|
- DB_PORT=5432
|
||||||
|
- DB_NAME=netbox
|
||||||
|
- DB_USER=netbox
|
||||||
|
- DB_PASSWORD=${DB_PASSWORD}
|
||||||
|
- REDIS_HOST=redis
|
||||||
|
- REDIS_PORT=6379
|
||||||
|
- SECRET_KEY=${SECRET_KEY}
|
||||||
|
restart: unless-stopped
|
||||||
|
|
||||||
|
volumes:
|
||||||
|
tailscale-state:
|
||||||
|
redis-data:
|
||||||
|
netbox-media:
|
||||||
|
netbox-reports:
|
||||||
|
netbox-scripts:
|
||||||
Reference in New Issue
Block a user