version: '3.9'
services:
  redis_master:
    image: redis:7-alpine
    container_name: redis_master
    command: redis-server --appendonly yes
    volumes:
      - redis_data:/data
    networks:
      - database-network
    healthcheck:
      test: ["CMD", "redis-cli", "ping"]
      interval: 30s
      timeout: 10s
      retries: 5
    restart: unless-stopped
    ports:
      - "6379:6379"

volumes:
  redis_data:
    driver: local

networks:
  database-network:
    external: true
