netbox-docker/docker-compose.yml

88 lines
2.2 KiB
YAML
Raw Normal View History

version: '3.4'
services:
netbox: &netbox
Update README.md (#1) * Update README.md * We don't want to use the netbox-community pull-request template * Update container building workflow * Only build amd64 images * Add our 'oxcert' branch as equivalent to upstream's 'release' branch * Tag the version of the container as OxCERT's modification This is just for the netbox container: the underlying netbox version will come from upstream * Build own own images and push to ghcr.io * Only build amd64 images * Only push images to GitHub Container Registry for the OxCERT organization * Refer to our private copy in the GitHub Container Registry ghcr.io * Use ghcr.io/oxcert/netbox for all netbox images Build and push to this repo. Read from it with docker-compose * Make releases relative to the 'oxcert' branch rather than upstream's 'release' branch. This is a different workflow than used in any of our other repos, where PRs, changes, etc. are first merged into a 'develop' branch, and the release process is to merge accumulated changes into the main 'oxcert' branch. Tag names for releases should follow whatever upstream is using with "-oxcert" appended. * Re-add the pull-request template But in a very cut-down form. We don't have an issue tracker on this repo, and we assume the intentions and motivations for any PR will have been discussed within the team already. We do, however, want all PRs to be against the 'develop' branch, in parallel to upstream's workflow. * On second thoughts, set container version to 1.0.0 This is OxCERT's version 1.0.0 of the containerized Netbox image which is basically the same as the 2.7.0 netbox-community equivalent. * Fix typo from upstream Function should have been called `git_rebase()` rather than duplicating the name of `git_merge()`
2023-10-13 10:34:37 +00:00
image: ghcr.io/oxcert/netbox:${VERSION-v3.6-1.0.0}
depends_on:
- postgres
- redis
2019-12-16 11:51:59 +00:00
- redis-cache
env_file: env/netbox.env
user: 'unit:root'
healthcheck:
start_period: 60s
timeout: 3s
interval: 15s
test: "curl -f http://localhost:8080/api/ || exit 1"
volumes:
- ./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
command:
- /opt/netbox/venv/bin/python
- /opt/netbox/netbox/manage.py
- rqworker
healthcheck:
start_period: 20s
timeout: 3s
interval: 15s
test: "ps -aux | grep -v grep | grep -q rqworker || exit 1"
netbox-housekeeping:
<<: *netbox
depends_on:
netbox:
condition: service_healthy
command:
- /opt/netbox/housekeeping.sh
healthcheck:
start_period: 20s
timeout: 3s
interval: 15s
test: "ps -aux | grep -v grep | grep -q housekeeping || exit 1"
# postgres
postgres:
image: docker.io/postgres:15-alpine
env_file: env/postgres.env
volumes:
- netbox-postgres-data:/var/lib/postgresql/data
# redis
redis:
image: docker.io/redis:7-alpine
command:
- sh
- -c # this is to evaluate the $REDIS_PASSWORD from the env
- redis-server --appendonly yes --requirepass $$REDIS_PASSWORD ## $$ because of docker-compose
2020-10-26 14:16:49 +00:00
env_file: env/redis.env
volumes:
- netbox-redis-data:/data
2019-12-16 11:51:59 +00:00
redis-cache:
2023-03-20 12:21:17 +00:00
image: docker.io/redis:7-alpine
2019-12-16 11:51:59 +00:00
command:
- sh
- -c # this is to evaluate the $REDIS_PASSWORD from the env
2020-10-26 14:16:49 +00:00
- redis-server --requirepass $$REDIS_PASSWORD ## $$ because of docker-compose
env_file: env/redis-cache.env
volumes:
- netbox-redis-cache-data:/data
volumes:
netbox-media-files:
driver: local
netbox-postgres-data:
driver: local
netbox-redis-cache-data:
driver: local
netbox-redis-data:
driver: local
netbox-reports-files:
driver: local
netbox-scripts-files:
driver: local