name: maspernf

services:
  mysql:
    image: mysql:5.6
    container_name: maspernf-mysql
    environment:
      MYSQL_ROOT_PASSWORD: root
      MYSQL_DATABASE: maspernf
      TZ: America/Sao_Paulo
    ports:
      - "3307:3306"
    volumes:
      - maspernf_mysql_data:/var/lib/mysql
      - ../migrations/001_create_nfse_tables.sql:/docker-entrypoint-initdb.d/001_create_nfse_tables.sql:ro
      - ../migrations/examples/002_create_mock_tenant_tables.sql:/docker-entrypoint-initdb.d/002_create_mock_tenant_tables.sql:ro
      - ../mock.sql:/docker-entrypoint-initdb.d/003_mock.sql:ro
    healthcheck:
      test: ["CMD", "mysqladmin", "ping", "-h", "127.0.0.1", "-uroot", "-proot"]
      interval: 5s
      timeout: 3s
      retries: 20

volumes:
  maspernf_mysql_data:
