Add Netbox container
This commit is contained in:
parent
bcc4dff3de
commit
33a6fd156f
3 changed files with 78 additions and 0 deletions
13
netbox/.env-example
Normal file
13
netbox/.env-example
Normal file
|
@ -0,0 +1,13 @@
|
|||
# NetBox
|
||||
NETBOX_VERSION=v4.2.6
|
||||
NETBOX_DOMAIN=netbox.intra.wira-gmbh.de
|
||||
SECRET_KEY= # Generate Key with "docker run --rm -it netboxcommunity/netbox:v4.2.6 python3 /opt/netbox/netbox/generate_secret_key.py"
|
||||
|
||||
# PostgreSQL
|
||||
POSTGRES_DB=netbox
|
||||
POSTGRES_USER=netbox
|
||||
POSTGRES_PASSWORD=strong-db-password
|
||||
NETBOX_POSTGRESQL_VERISION=16
|
||||
|
||||
# Redis
|
||||
NETBOX_REDIS_VERSION=7
|
0
netbox/README.md
Normal file
0
netbox/README.md
Normal file
65
netbox/docker-compose.yml
Normal file
65
netbox/docker-compose.yml
Normal file
|
@ -0,0 +1,65 @@
|
|||
---
|
||||
services:
|
||||
postgres:
|
||||
image: postgres:${NETBOX_POSTGRESQL_VERISION:-16}
|
||||
restart: unless-stopped
|
||||
environment:
|
||||
POSTGRES_DB: ${POSTGRES_DB:?error}
|
||||
POSTGRES_USER: ${POSTGRES_USER:?error}
|
||||
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:?error}
|
||||
volumes:
|
||||
- netbox-db:/var/lib/postgresql/data
|
||||
networks:
|
||||
- netbox
|
||||
|
||||
redis:
|
||||
image: redis:${NETBOX_REDIS_VERSION:-7}
|
||||
restart: unless-stopped
|
||||
volumes:
|
||||
- netbox-redis:/data
|
||||
networks:
|
||||
- netbox
|
||||
|
||||
netbox:
|
||||
image: netboxcommunity/netbox:${NETBOX_VERSION:-v4.2.6}
|
||||
restart: unless-stopped
|
||||
depends_on:
|
||||
- postgres
|
||||
- redis
|
||||
env_file: .env
|
||||
networks:
|
||||
- netbox
|
||||
- traefik
|
||||
environment:
|
||||
DB_NAME: ${POSTGRES_DB:?error}
|
||||
DB_USER: ${POSTGRES_USER:?error}
|
||||
DB_PASSWORD: ${POSTGRES_PASSWORD:?error}
|
||||
DB_HOST: postgres
|
||||
REDIS_HOST: redis
|
||||
REDIS_DATABASE: 0
|
||||
REDIS_CACHE_DATABASE: 1
|
||||
SECRET_KEY: ${SECRET_KEY:?error}
|
||||
ALLOWED_HOSTS: "*"
|
||||
volumes:
|
||||
- netbox-static:/opt/netbox/netbox/static
|
||||
labels:
|
||||
- "traefik.enable=true"
|
||||
- "traefik.http.routers.netbox.entrypoints=http"
|
||||
- "traefik.http.routers.netbox.rule=Host(`${NETBOX_DOMAIN:?error}`)"
|
||||
- "traefik.http.middlewares.netbox-https-redirect.redirectscheme.scheme=https"
|
||||
- "traefik.http.routers.netbox.middlewares=traefik-https-redirect"
|
||||
- "traefik.http.routers.netbox-secure.entrypoints=https"
|
||||
- "traefik.http.routers.netbox-secure.rule=Host(`${NETBOX_DOMAIN:?error}`)"
|
||||
- "traefik.http.routers.netbox-secure.tls=true"
|
||||
- "traefik.http.services.netbox.loadbalancer.server.port=8080"
|
||||
- "traefik.docker.network=traefik"
|
||||
|
||||
volumes:
|
||||
netbox-db:
|
||||
netbox-redis:
|
||||
netbox-static:
|
||||
|
||||
networks:
|
||||
netbox:
|
||||
traefik:
|
||||
external: true
|
Loading…
Add table
Reference in a new issue