diff --git a/.gitignore b/.gitignore index 8e90907..6eada06 100644 --- a/.gitignore +++ b/.gitignore @@ -8,3 +8,4 @@ configuration/* !configuration/extra.py configuration/ldap/* !configuration/ldap/ldap_config.py +prometheus.yml diff --git a/README.md b/README.md index 25c1286..7c4d20d 100644 --- a/README.md +++ b/README.md @@ -79,7 +79,7 @@ The default credentials are: ## Documentation Please refer [to our wiki on Github][netbox-docker-wiki] for further information on how to use this Netbox Docker image properly. -It covers advanced topics such as using secret files, deployment to Kubernetes as well as NAPALM and LDAP configuration. +It covers advanced topics such as using files for secrets, deployment to Kubernetes, monitoring and configuring NAPALM or LDAP. [netbox-docker-wiki]: https://github.com/netbox-community/netbox-docker/wiki/ diff --git a/docker-compose.yml b/docker-compose.yml index 001694c..8a2c575 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -27,6 +27,8 @@ services: - /opt/netbox/netbox/manage.py command: - rqworker + + # nginx nginx: command: nginx -c /etc/netbox-nginx/nginx.conf image: nginx:1.19-alpine @@ -37,11 +39,15 @@ services: volumes: - netbox-static-files:/opt/netbox/netbox/static:ro - netbox-nginx-config:/etc/netbox-nginx/:ro + + # postgres postgres: image: postgres:12-alpine env_file: env/postgres.env volumes: - netbox-postgres-data:/var/lib/postgresql/data + + # redis redis: image: redis:6-alpine command: @@ -58,6 +64,7 @@ services: - -c # this is to evaluate the $REDIS_PASSWORD from the env - redis-server --requirepass $$REDIS_PASSWORD ## $$ because of docker-compose env_file: env/redis-cache.env + volumes: netbox-static-files: driver: local diff --git a/docker/gunicorn_config.py b/docker/gunicorn_config.py index 4ce7763..9e22310 100644 --- a/docker/gunicorn_config.py +++ b/docker/gunicorn_config.py @@ -6,3 +6,4 @@ errorlog = '-' accesslog = '-' capture_output = False loglevel = 'info' +raw_env = 'prometheus_multiproc_dir=/tmp/metrics' diff --git a/docker/nginx.conf b/docker/nginx.conf index edbd927..75e3bfd 100644 --- a/docker/nginx.conf +++ b/docker/nginx.conf @@ -32,4 +32,13 @@ http { add_header P3P 'CP="ALL DSP COR PSAa PSDa OUR NOR ONL UNI COM NAV"'; } } + + server { + listen 8081; + access_log off; + + location = /stub_status { + stub_status; + } + } } diff --git a/env/netbox.env b/env/netbox.env index 9849ce6..8da5259 100644 --- a/env/netbox.env +++ b/env/netbox.env @@ -14,11 +14,12 @@ EMAIL_USE_SSL=false EMAIL_USE_TLS=false EMAIL_SSL_CERTFILE= EMAIL_SSL_KEYFILE= +MAX_PAGE_SIZE=1000 MEDIA_ROOT=/opt/netbox/netbox/media +METRICS_ENABLED=false NAPALM_USERNAME= NAPALM_PASSWORD= NAPALM_TIMEOUT=10 -MAX_PAGE_SIZE=1000 REDIS_HOST=redis REDIS_PASSWORD=H733Kdjndks81 REDIS_DATABASE=0 @@ -27,6 +28,7 @@ REDIS_CACHE_HOST=redis-cache REDIS_CACHE_PASSWORD=t4Ph722qJ5QHeQ1qfu36 REDIS_CACHE_DATABASE=1 REDIS_CACHE_SSL=false +RELEASE_CHECK_URL=https://api.github.com/repos/netbox-community/netbox/releases SECRET_KEY=r8OwDznj!!dci#P9ghmRfdu1Ysxm0AiPeDCQhKE+N_rClfWNj SKIP_STARTUP_SCRIPTS=false SKIP_SUPERUSER=false @@ -35,4 +37,3 @@ SUPERUSER_EMAIL=admin@example.com SUPERUSER_PASSWORD=admin SUPERUSER_API_TOKEN=0123456789abcdef0123456789abcdef01234567 WEBHOOKS_ENABLED=true -RELEASE_CHECK_URL=https://api.github.com/repos/netbox-community/netbox/releases