services:
  redis:
    image: redis:alpine
    container_name: redis
    restart: always
    networks:
      discord-net:
        ipv4_address: ${REDIS_IP}
    volumes:
      - redis_data:/data
    ports:
      - ${REDIS_PORT}:${REDIS_PORT}
    healthcheck:
      test: ["CMD", "redis-cli", "PING"]
      interval: 10s
      timeout: 5s
      retries: 5
      start_period: 5s

networks:
  discord-net:
    driver: bridge
    ipam:
      driver: default
      config:
        - subnet: ${SUBNET_ADDRESS}/16

volumes:
  redis_data:
