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