Compare commits

..

6 Commits

Author SHA1 Message Date
6d5d303b64 testing out the stack deploy via portainer with updates 2024-06-16 19:11:01 +00:00
c7614aa3c3 stupid docker stack compatability 2024-05-30 02:56:51 +00:00
f687540c40 fix deploy error? 2024-05-30 02:36:27 +00:00
3423df950a first try 2024-05-30 02:28:16 +00:00
Tobias Genannt
0c99ff8b56 Merge pull request #1225 from netbox-community/develop
Version 2.9.1
2024-05-07 18:29:09 +02:00
Tobias Genannt
6d25a54d49 Merge pull request #1219 from netbox-community/develop
Version 2.9.0
2024-05-06 21:26:10 +02:00
3 changed files with 76 additions and 32 deletions

View File

@@ -0,0 +1,63 @@
services:
netbox:
networks:
- caddy
- netbox
ports:
- 8000:8080
configs:
- source: configuration.py
target: /etc/netbox/config/configuration.py
- source: ldap_config.py
target: /etc/netbox/config/ldap/ldap_config.py
secrets:
- source: netbox.superuser.pwd
target: superuser_password
- source: netbox.db.pwd
target: db_password
- source: netbox.secretkey
target: secret_key
- source: netbox.redis.pwd
target: redis_password
- source: netbox.redis.pwd
target: redis_cache_password
netbox-worker:
restart: unless-stopped
networks:
- netbox
netbox-housekeeping:
restart: unless-stopped
networks:
- netbox
redis:
restart: unless-stopped
networks:
- netbox
redis-cache:
restart: unless-stopped
networks:
- netbox
secrets:
netbox.superuser.pwd:
external: true
netbox.db.pwd:
external: true
netbox.secretkey:
external: true
netbox.redis.pwd:
external: true
networks:
caddy:
external: true
netbox:
configs:
configuration.py:
external: true
name: netbox-configuration.py-v0
ldap_config.py:
external: true
name: netbox-ldap_config.py-v0

View File

@@ -2,7 +2,7 @@ services:
netbox: &netbox
image: docker.io/netboxcommunity/netbox:${VERSION-v4.0-2.9.1}
depends_on:
- postgres
# - postgres
- redis
- redis-cache
env_file: env/netbox.env
@@ -13,16 +13,14 @@ services:
interval: 15s
test: "curl -f http://localhost:8080/login/ || exit 1"
volumes:
- ./configuration:/etc/netbox/config:z,ro
- init-files:/opt/init:ro
# - ./configuration:/etc/netbox/config:z,ro
- netbox-media-files:/opt/netbox/netbox/media:rw
- netbox-reports-files:/opt/netbox/netbox/reports:rw
- netbox-scripts-files:/opt/netbox/netbox/scripts:rw
netbox-worker:
<<: *netbox
depends_on:
netbox:
condition: service_healthy
- netbox
command:
- /opt/netbox/venv/bin/python
- /opt/netbox/netbox/manage.py
@@ -35,8 +33,7 @@ services:
netbox-housekeeping:
<<: *netbox
depends_on:
netbox:
condition: service_healthy
- netbox
command:
- /opt/netbox/housekeeping.sh
healthcheck:
@@ -46,11 +43,11 @@ services:
test: "ps -aux | grep -v grep | grep -q housekeeping || exit 1"
# postgres
postgres:
image: docker.io/postgres:16-alpine
env_file: env/postgres.env
volumes:
- netbox-postgres-data:/var/lib/postgresql/data
# postgres:
# image: docker.io/postgres:16-alpine
# env_file: env/postgres.env
# volumes:
# - netbox-postgres-data:/var/lib/postgresql/data
# redis
redis:
@@ -73,12 +70,10 @@ services:
- netbox-redis-cache-data:/data
volumes:
init-files:
driver: local
netbox-media-files:
driver: local
netbox-postgres-data:
driver: local
# netbox-postgres-data:
# driver: local
netbox-redis-cache-data:
driver: local
netbox-redis-data:

View File

@@ -1,19 +1,12 @@
#!/bin/bash
# Runs on every start of the NetBox Docker container
# Stop when an error occurs
# Stop when an error occures
set -e
# Allows NetBox to be run as non-root users
umask 002
if [ -d /opt/init/pre ]; then
find /opt/init/pre -type f -name \*.sh | sort -u | while read -r FILE; do
echo "⚙️ Running pre-init script '${FILE}'..."
/bin/bash -e "${FILE}" "$@"
done
fi
# Load correct Python3 env
# shellcheck disable=SC1091
source /opt/netbox/venv/bin/activate
@@ -98,15 +91,8 @@ except Token.DoesNotExist:
pass
END
if [ -d /opt/init/post ]; then
find /opt/init/post -type f -name \*.sh | sort -u | while read -r FILE; do
echo "⚙️ Running post-init script '${FILE}'..."
/bin/bash -e "${FILE}" "$@"
done
fi
echo "✅ Initialisation is done."
# Launch whatever is passed by docker
# (i.e. the CMD instruction in the Dockerfile)
# (i.e. the RUN instruction in the Dockerfile)
exec "$@"