version: '3.7'

services:
  mysql:
    # https://hub.docker.com/r/bitnami/mysql
    image: bitnami/mysql:8.0.32-debian-11-r12
    ports:
      - '21306:3306'
    volumes:
      #- '/octopus-server/mysql/data:/bitnami/mysql/data'
      - 'mysql_data:/bitnami/mysql/data'
      # - '/octopus-server/mysql/wdd-server.sql:/docker-entrypoint-initdb.d/wdd-server.sql'
    networks:
      - app-tier
    environment:
      - MYSQL_ROOT_USER=boge
      - MYSQL_ROOT_PASSWORD=boge8tingH
      - MYSQL_CHARACTER_SET=utf8mb4
      - MYSQL_COLLATE:utf8_general_ci
      - MYSQL_AUTHENTICATION_PLUGIN=caching_sha2_password
    healthcheck:
      test: [ 'CMD', '/opt/bitnami/scripts/mysql/healthcheck.sh' ]
      interval: 15s
      timeout: 5s
      retries: 6
  rabbitmq:
    # https://hub.docker.com/r/bitnami/rabbitmq
    image: docker.io/bitnami/rabbitmq:3.11.10-debian-11-r0
    ports:
      - '4369'
      - '5551'
      - '5552'
      - '20672:5672'
      - '25672'
      - '20678:15672'
    environment:
      - RABBITMQ_VHOST=/
      - RABBITMQ_VHOSTS=/dev
      - RABBITMQ_USERNAME=boge
      - RABBITMQ_PASSWORD=boge8tingH
      - RABBITMQ_SECURE_PASSWORD=no
      - RABBITMQ_LOAD_DEFINITIONS=no
      - RABBITMQ_NODE_PORT_NUMBER=5672
      - RABBITMQ_NODE_SSL_PORT_NUMBER=5671
      - RABBITMQ_MANAGEMENT_PORT_NUMBER=15672
    volumes:
      - 'rabbitmq_data:/bitnami/rabbitmq/mnesia'
  redis:
    image: redis/redis-stack:7.2.0-v18
    networks:
      - app-tier
    ports:
      - '21370:6379'
      - '21371:8001'
    environment:
      # duration of 7 days
      - REDISTIMESERIES_ARGS=DUPLICATE_POLICY LAST RETENTION_POLICY 604800000
      # Redis 6.0 features a new multi-threading model
      - REDIS_ARGS=protected-mode no masterauth boge8tingH appendonly yes
      #- REDIS_DISABLE_COMMANDS=FLUSHDB,FLUSHALL
    volumes:
      - 'redis_data:/data'
#  redis:
#    # https://hub.docker.com/r/bitnami/redis
#    image: bitnami/redis:6.2.11-debian-11-r1
#    networks:
#      - app-tier
#    environment:
#      - REDIS_PASSWORD=boge8tingH
#      # Redis 6.0 features a new multi-threading model
#      - REDIS_IO_THREADS=4
#      - REDIS_IO_THREADS_DO_READS=yes
#      - REDIS_PORT_NUMBER=6379
#      - REDIS_REPLICATION_MODE=master
#      #- REDIS_DISABLE_COMMANDS=FLUSHDB,FLUSHALL
#    ports:
#      - '21370:6379'
#    volumes:
#      - 'redis_data:/bitnami/redis/data'

volumes:
  mysql_data:
    driver: local
  rabbitmq_data:
    driver: local
  redis_data:
    driver: local

networks:
  app-tier:
    driver: bridge