version: '3.9'

services:
  redis_master:
    image: redis:7-alpine
    command: ["redis-server", "--appendonly", "yes"]
    volumes:
      - redis_data:/data
    networks:
      - database-network
    deploy:
      replicas: 1
      placement:
        constraints:
          - "node.labels.role==db"

volumes:
  redis_data:
    driver: local

networks:
  database-network:
    external: true
