netbox-docker/docker-compose.test.yml

71 lines
1.9 KiB
YAML
Raw Normal View History

services:
2023-03-16 21:44:08 +01:00
netbox: &netbox
2024-04-19 21:14:21 +02:00
image: ${IMAGE-docker.io/netboxcommunity/netbox:latest}
depends_on:
postgres:
condition: service_healthy
redis:
2023-03-29 12:40:32 +02:00
condition: service_healthy
redis-cache:
2023-03-29 12:40:32 +02:00
condition: service_healthy
env_file: env/netbox.env
user: 'unit:root'
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:
2024-05-25 15:26:07 +02:00
test: curl -f http://localhost:8080/login/ || exit 1
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
netbox-worker:
<<: *netbox
command:
- /opt/netbox/venv/bin/python
- /opt/netbox/netbox/manage.py
- rqworker
healthcheck:
2024-04-19 21:14:21 +02:00
test: ps -aux | grep -v grep | grep -q rqworker || exit 1
2023-03-16 21:44:08 +01:00
start_period: 40s
timeout: 3s
interval: 15s
netbox-housekeeping:
<<: *netbox
command:
- /opt/netbox/housekeeping.sh
healthcheck:
2024-04-19 21:14:21 +02:00
test: ps -aux | grep -v grep | grep -q housekeeping || exit 1
2023-03-16 21:44:08 +01:00
start_period: 40s
timeout: 3s
interval: 15s
2024-04-19 21:14:21 +02:00
postgres:
2024-04-19 21:14:21 +02:00
image: docker.io/postgres:16-alpine
env_file: env/postgres.env
healthcheck:
2024-04-19 21:14:21 +02:00
test: pg_isready -q -t 2 -d $$POSTGRES_DB -U $$POSTGRES_USER ## $$ because of docker-compose
start_period: 20s
interval: 1s
timeout: 5s
retries: 5
2024-04-19 21:14:21 +02:00
2023-03-29 12:40:32 +02:00
redis: &redis
2024-04-19 21:14:21 +02:00
image: docker.io/valkey/valkey:7.2-alpine
command:
- sh
- -c # this is to evaluate the $REDIS_PASSWORD from the env
2024-04-19 21:23:06 +02:00
- valkey-server --save "" --appendonly no --requirepass $$REDIS_PASSWORD ## $$ because of docker-compose
env_file: env/redis.env
2023-03-29 12:40:32 +02:00
healthcheck:
2024-04-19 21:14:21 +02:00
test: "[ $$(valkey-cli --pass \"$${REDIS_PASSWORD}\" ping) = 'PONG' ]"
start_period: 5s
2023-03-29 12:40:32 +02:00
timeout: 3s
2024-04-19 21:14:21 +02:00
interval: 1s
retries: 5
redis-cache:
2023-03-29 12:40:32 +02:00
<<: *redis
env_file: env/redis-cache.env
2024-04-19 21:14:21 +02:00
volumes:
netbox-media-files:
driver: local