2019-12-23 17:53:19 +01:00
|
|
|
services:
|
2023-03-16 21:44:08 +01:00
|
|
|
netbox: &netbox
|
2019-12-23 17:53:19 +01:00
|
|
|
image: ${IMAGE-netboxcommunity/netbox:latest}
|
|
|
|
depends_on:
|
2022-11-30 09:52:07 +01:00
|
|
|
postgres:
|
|
|
|
condition: service_healthy
|
|
|
|
redis:
|
2023-03-29 12:40:32 +02:00
|
|
|
condition: service_healthy
|
2022-11-30 09:52:07 +01:00
|
|
|
redis-cache:
|
2023-03-29 12:40:32 +02:00
|
|
|
condition: service_healthy
|
2019-12-23 17:53:19 +01:00
|
|
|
env_file: env/netbox.env
|
2021-09-24 08:16:07 +02:00
|
|
|
user: 'unit:root'
|
2019-12-23 17:53:19 +01:00
|
|
|
volumes:
|
2023-07-07 08:12:33 +02:00
|
|
|
- ./test-configuration/test_config.py:/etc/netbox/config/test_config.py:z,ro
|
2023-03-16 21:44:08 +01:00
|
|
|
healthcheck:
|
2023-04-06 12:05:02 +02:00
|
|
|
start_period: ${NETBOX_START_PERIOD-120s}
|
2023-03-16 21:44:08 +01:00
|
|
|
timeout: 3s
|
|
|
|
interval: 15s
|
|
|
|
test: "curl -f http://localhost:8080/api/ || exit 1"
|
|
|
|
netbox-worker:
|
|
|
|
<<: *netbox
|
|
|
|
command:
|
|
|
|
- /opt/netbox/venv/bin/python
|
|
|
|
- /opt/netbox/netbox/manage.py
|
|
|
|
- rqworker
|
|
|
|
healthcheck:
|
|
|
|
start_period: 40s
|
|
|
|
timeout: 3s
|
|
|
|
interval: 15s
|
|
|
|
test: "ps -aux | grep -v grep | grep -q rqworker || exit 1"
|
|
|
|
netbox-housekeeping:
|
|
|
|
<<: *netbox
|
|
|
|
command:
|
|
|
|
- /opt/netbox/housekeeping.sh
|
|
|
|
healthcheck:
|
|
|
|
start_period: 40s
|
|
|
|
timeout: 3s
|
|
|
|
interval: 15s
|
|
|
|
test: "ps -aux | grep -v grep | grep -q housekeeping || exit 1"
|
2019-12-23 17:53:19 +01:00
|
|
|
postgres:
|
2023-09-23 16:42:28 +02:00
|
|
|
image: postgres:16-alpine
|
2019-12-23 17:53:19 +01:00
|
|
|
env_file: env/postgres.env
|
2022-11-30 09:52:07 +01:00
|
|
|
healthcheck:
|
2023-03-29 12:40:32 +02:00
|
|
|
test: "pg_isready -t 2 -d $$POSTGRES_DB -U $$POSTGRES_USER" ## $$ because of docker-compose
|
2022-11-30 09:52:07 +01:00
|
|
|
interval: 10s
|
|
|
|
timeout: 5s
|
|
|
|
retries: 5
|
2023-03-29 12:40:32 +02:00
|
|
|
redis: &redis
|
2022-06-09 08:12:46 +02:00
|
|
|
image: redis:7-alpine
|
2019-12-23 17:53:19 +01:00
|
|
|
command:
|
|
|
|
- sh
|
|
|
|
- -c # this is to evaluate the $REDIS_PASSWORD from the env
|
2020-02-14 12:35:47 +01:00
|
|
|
- redis-server --appendonly yes --requirepass $$REDIS_PASSWORD ## $$ because of docker-compose
|
2019-12-23 17:53:19 +01:00
|
|
|
env_file: env/redis.env
|
2023-03-29 12:40:32 +02:00
|
|
|
healthcheck:
|
|
|
|
start_period: 20s
|
|
|
|
timeout: 3s
|
|
|
|
interval: 15s
|
|
|
|
test: "timeout 2 redis-cli ping"
|
2020-02-14 12:35:47 +01:00
|
|
|
redis-cache:
|
2023-03-29 12:40:32 +02:00
|
|
|
<<: *redis
|
2020-02-14 12:35:47 +01:00
|
|
|
env_file: env/redis-cache.env
|
2019-12-23 17:53:19 +01:00
|
|
|
volumes:
|
|
|
|
netbox-media-files:
|
|
|
|
driver: local
|