version: "3.9"

services:
  database:
    image: mysql/mysql-server
    command: --default-authentication-plugin=mysql_native_password
    restart: always
    environment:
      - MYSQL_DATABASE=$DB_NAME
      - MYSQL_USER=$DB_AUTH_USER
      - MYSQL_PASSWORD=$DB_AUTH_PASS
      - MYSQL_ROOT_PASSWORD=$DB_AUTH_PASS
      - MYSQL_ROOT_HOST=$DB_ROOT_HOST
    ports:
      - "$DB_PORT:3306"
    volumes:
      - $DB_DATA_LOCATION:/var/lib/mysql