Switch to valkey and add healthcheck

This commit is contained in:
Christian Mäder 2024-04-19 17:11:06 +02:00
parent c51747a163
commit 3c8449fbec

View File

@ -53,20 +53,30 @@ services:
# redis # redis
redis: redis:
image: docker.io/redis:7-alpine image: docker.io/valkey/valkey:7.2-alpine
command: command:
- sh - sh
- -c # this is to evaluate the $REDIS_PASSWORD from the env - -c # this is to evaluate the $REDIS_PASSWORD from the env
- redis-server --appendonly yes --requirepass $$REDIS_PASSWORD ## $$ because of docker-compose - valkey-server --appendonly yes --requirepass $$REDIS_PASSWORD ## $$ because of docker-compose
healthcheck:
test: "[ $$(valkey-cli --pass \"$${REDIS_PASSWORD}\" ping) = 'PONG' ]"
interval: 1s
timeout: 3s
retries: 5
env_file: env/redis.env env_file: env/redis.env
volumes: volumes:
- netbox-redis-data:/data - netbox-redis-data:/data
redis-cache: redis-cache:
image: docker.io/redis:7-alpine image: docker.io/valkey/valkey:7.2-alpine
command: command:
- sh - sh
- -c # this is to evaluate the $REDIS_PASSWORD from the env - -c # this is to evaluate the $REDIS_PASSWORD from the env
- redis-server --requirepass $$REDIS_PASSWORD ## $$ because of docker-compose - valkey-server --requirepass $$REDIS_PASSWORD ## $$ because of docker-compose
healthcheck:
test: "[ $$(valkey-cli --pass \"$${REDIS_PASSWORD}\" ping) = 'PONG' ]"
interval: 1s
timeout: 3s
retries: 5
env_file: env/redis-cache.env env_file: env/redis-cache.env
volumes: volumes:
- netbox-redis-cache-data:/data - netbox-redis-cache-data:/data