version: '2.4'
services:
  mysql:
    image: ${CI_REGISTRY}/mattermost/ci/images/mysql:5.7-1
    restart: always
    environment:
      MYSQL_ROOT_HOST: "%"
      MYSQL_ROOT_PASSWORD: mostest
      MYSQL_PASSWORD: mostest
      MYSQL_USER: mmuser
      MYSQL_DATABASE: mattermost_test
    healthcheck:
      test: ["CMD", "mysqladmin" ,"ping", "-h", "localhost"]
      interval: 5s
      timeout: 10s
      retries: 3
    tmpfs: /var/lib/mysql
    volumes:
      - "./docker/mysql.conf.d:/etc/mysql/conf.d"
    networks:
      default:
        aliases:
          - mysql

  start_dependencies:
    image: ${CI_REGISTRY}/mattermost/ci/images/mattermost-wait-for-dep:latest-1
    depends_on:
      - mysql
    command: mysql:3306
    networks:
      default:

networks:
  default:
    external:
      name: ${COMPOSE_PROJECT_NAME}
