version: "3.9"

services:
  mssql:
    image: mcr.microsoft.com/azure-sql-edge:latest
    restart: always
    environment:
      ACCEPT_EULA: Y
      MSSQL_SA_PASSWORD: ${MSSQL_PASSWORD}
      MSSQL_PID: Developer
    volumes:
      - edgesql_dev_data:/var/opt/mssql
      - ../util/Migrator:/mnt/migrator/
      - ./helpers/mssql:/mnt/helpers
      - ./.data/mssql:/mnt/data
    ports:
      - '1433:1433'
    profiles:
      - cloud
      - mssql
  
  storage:
    image: mcr.microsoft.com/azure-storage/azurite:latest
    ports: 
      - "10000:10000" 
      - "10001:10001"
      - "10002:10002"
    volumes:
      - ./.data/azurite:/data
    profiles:
      - storage
      - cloud
  
  mail:
    image: sj26/mailcatcher:latest
    ports: 
      - "${MAILCATCHER_PORT}:1080" 
      - "10250:1025"
    profiles:
      - mail

  postgres:
    image: postgres:14
    restart: always
    ports: 
      - "5432:5432"
    environment:
      POSTGRES_DB: vault_dev
      POSTGRES_USER: postgres
      POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
    volumes:
      - postgres_dev_data:/var/lib/postgresql/data
      - ./.data/postgres/config:/etc/postgresql
      - ./.data/postgres/log:/var/log/postgresql
    profiles:
      - postgres

  mysql:
    image: mysql:8
    container_name: bw-mysql
    restart: always
    ports: 
      - "3306:3306"
    command: --default-authentication-plugin=mysql_native_password
    environment:
      MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD}
      MYSQL_DATABASE: vault_dev
    volumes:
      - mysql_dev_data:/var/lib/mysql
    profiles:
      - mysql

volumes:
  edgesql_dev_data:
  postgres_dev_data:
  mysql_dev_data:
