|
| 1 | +name: diode-netbox-plugin-4.2.3 |
| 2 | +services: |
| 3 | + netbox: &netbox |
| 4 | + image: netboxcommunity/netbox:v4.2.3-3.1.1-diode-netbox-plugin |
| 5 | + build: |
| 6 | + context: . |
| 7 | + dockerfile: Dockerfile-diode-netbox-plugin |
| 8 | + pull: true |
| 9 | + depends_on: |
| 10 | + - netbox-postgres |
| 11 | + - netbox-redis |
| 12 | + - netbox-redis-cache |
| 13 | + env_file: netbox/env/netbox.env |
| 14 | + user: 'unit:root' |
| 15 | + healthcheck: |
| 16 | + start_period: 60s |
| 17 | + timeout: 3s |
| 18 | + interval: 15s |
| 19 | + test: "curl -f http://localhost:8080/netbox/api/ || exit 1" |
| 20 | + volumes: |
| 21 | + - ./netbox/docker-entrypoint.sh:/opt/netbox/docker-entrypoint.sh:z,ro |
| 22 | + - ./netbox/nginx-unit.json:/opt/netbox/nginx-unit.json:z,ro |
| 23 | + - ../../netbox_diode_plugin:/opt/netbox/netbox/netbox_diode_plugin:z,rw |
| 24 | + - ../oauth2/secrets:/run/secrets:z,ro |
| 25 | + - ./netbox/launch-netbox.sh:/opt/netbox/launch-netbox.sh:z,ro |
| 26 | + - ./netbox/plugins_dev.py:/etc/netbox/config/plugins.py:z,ro |
| 27 | + - ./coverage:/opt/netbox/netbox/coverage:z,rw |
| 28 | + - netbox-media-files:/opt/netbox/netbox/media:rw |
| 29 | + - netbox-reports-files:/opt/netbox/netbox/reports:rw |
| 30 | + - netbox-scripts-files:/opt/netbox/netbox/scripts:rw |
| 31 | + extra_hosts: |
| 32 | + - "host.docker.internal:host-gateway" |
| 33 | + ports: |
| 34 | + - "8000:8080" |
| 35 | + |
| 36 | + netbox-worker: |
| 37 | + <<: *netbox |
| 38 | + depends_on: |
| 39 | + netbox: |
| 40 | + condition: service_healthy |
| 41 | + command: |
| 42 | + - /opt/netbox/venv/bin/python |
| 43 | + - /opt/netbox/netbox/manage.py |
| 44 | + - rqworker |
| 45 | + healthcheck: |
| 46 | + test: ps -aux | grep -v grep | grep -q rqworker || exit 1 |
| 47 | + start_period: 20s |
| 48 | + timeout: 3s |
| 49 | + interval: 15s |
| 50 | + ports: [] |
| 51 | + |
| 52 | + # postgres |
| 53 | + netbox-postgres: |
| 54 | + image: docker.io/postgres:16-alpine |
| 55 | + env_file: netbox/env/postgres.env |
| 56 | + volumes: |
| 57 | + - netbox-postgres-data:/var/lib/postgresql/data |
| 58 | + |
| 59 | + # redis |
| 60 | + netbox-redis: |
| 61 | + image: docker.io/redis:7-alpine |
| 62 | + command: |
| 63 | + - sh |
| 64 | + - -c # this is to evaluate the $REDIS_PASSWORD from the env |
| 65 | + - redis-server --appendonly yes --requirepass $$REDIS_PASSWORD ## $$ because of docker-compose |
| 66 | + env_file: netbox/env/redis.env |
| 67 | + volumes: |
| 68 | + - netbox-redis-data:/data |
| 69 | + |
| 70 | + netbox-redis-cache: |
| 71 | + image: docker.io/redis:7-alpine |
| 72 | + command: |
| 73 | + - sh |
| 74 | + - -c # this is to evaluate the $REDIS_PASSWORD from the env |
| 75 | + - redis-server --requirepass $$REDIS_PASSWORD ## $$ because of docker-compose |
| 76 | + env_file: netbox/env/redis-cache.env |
| 77 | + volumes: |
| 78 | + - netbox-redis-cache-data:/data |
| 79 | + |
| 80 | +volumes: |
| 81 | + netbox-media-files: |
| 82 | + driver: local |
| 83 | + netbox-postgres-data: |
| 84 | + driver: local |
| 85 | + netbox-redis-cache-data: |
| 86 | + driver: local |
| 87 | + netbox-redis-data: |
| 88 | + driver: local |
| 89 | + netbox-reports-files: |
| 90 | + driver: local |
| 91 | + netbox-scripts-files: |
| 92 | + driver: local |
0 commit comments