You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.
 

83 lines
2.1 KiB

---
version: "3"
volumes:
netbox-static-files:
driver: local
netbox-nginx-config:
driver: local
netbox-media-files:
driver: local
netbox-redis-data:
driver: local
services:
netbox: &netbox
image: netboxcommunity/netbox:v2.9.9
container_name: netbox-instance
hostname: netbox-instance
depends_on:
- postgres
- redis
- redis-cache
- netbox-worker
env_file: env/netbox.env
user: '101'
ports:
- "8124:8080"
volumes:
- ./etc/netbox/etc/netbox/config:/etc/netbox/config:z,ro
- ./etc/netbox/etc/netbox/reports:/etc/netbox/reports:z,ro
- ./etc/netbox/etc/netbox/scripts:/etc/netbox/scripts:z,ro
- ./etc/netbox/opt/netbox/initializers:/opt/netbox/initializers:z,ro
- ./etc/netbox/opt/netbox/startup_scripts:/opt/netbox/startup_scripts:z,ro
- netbox-nginx-config:/etc/netbox-nginx:z
- netbox-static-files:/opt/netbox/netbox/static:z
- netbox-media-files:/opt/netbox/netbox/media:z
netbox-worker:
<<: *netbox
container_name: netbox-worker
hostname: netbox-worker
depends_on:
- redis
entrypoint:
- python3
- /opt/netbox/netbox/manage.py
command:
- rqworker
postgres:
image: postgres:13.1-alpine
container_name: postgres
hostname: postgres
env_file: env/postgres.env
volumes:
- ./etc/postgres/var/lib/postgresql/data:/var/lib/postgresql/data
redis:
image: redis:6.0.9-alpine
container_name: redis
hostname: redis
command:
- sh
- -c # this is to evaluate the $REDIS_PASSWORD from the env
- redis-server --appendonly yes --requirepass $$REDIS_PASSWORD ## $$ because of docker-compose
env_file: env/redis.env
volumes:
- netbox-redis-data:/data
redis-cache:
image: redis:6.0.9-alpine
container_name: redis-cache
hostname: redis-cache
command:
- sh
- -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
...