version: '3.9'

services:
  mysqltest:
    image: mysql:8.0
    ports:
      - "3305:3306"
    container_name: niki-database-test
    volumes:
      - dbdatatest:/var/lib/mysql
    restart: always
    command: [ 'mysqld', '--character-set-server=utf8mb4', '--collation-server=utf8mb4_unicode_ci' ]
    environment:
      MYSQL_ROOT_PASSWORD: 123456
      MYSQL_DATABASE: test_db
      MYSQL_USER: testuser
      MYSQL_PASSWORD: test1234

  niki-redis-test:
    image: bitnami/redis:6.2
    container_name: niki-redis-test
    restart: always
    ports:
      - '6381:6379'
    # TODO - remove `--save "" --appendonly no` from command to persist data
    command: redis-server --loglevel warning --protected-mode no --save "" --appendonly no
    environment:
      - ALLOW_EMPTY_PASSWORD=yes
    volumes:
      - niki-redis-data-test:/data



volumes:
  dbdatatest:
  niki-redis-data-test:



#    docker-compose -f docker-compose.dev.yaml up -d