volumes:
  datafiles:


services:
  mysql:
    image: mysql:8.0.26
    container_name: mysql8.0.26-prism
    ports:
      - "33061:3306"
    environment:
      MYSQL_ROOT_PASSWORD: root
      MYSQL_USER: testuser
      MYSQL_PASSWORD: Rock-A-Billy11
      MYSQL_DATABASE: levisssd_erp_dev2
    volumes:
      - datafiles:/var/lib/mysql
      #loads the sql dump file
      - ./data:/docker-entrypoint-initdb.d
      #config files need to be set to read-only mode on windows host machine
      #or mysql will ignore them
      - ./data/config:/etc/mysql/conf.d
    restart: always

  website:
    container_name: php81-prism
    build:
      context: .
      dockerfile: Dockerfile
    volumes:
      - ./.env.admin.erpdev2.levisrmlocal.com:/var/www #Update for your app, need a mapping for every file
      - ./PRISM-Code:/var/www/html #website files
      - ./:/var/www #Env files
      - ./data/php/xdebug.ini:/usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini #xdebug config
      - ./data/php/error_reporting.ini:/usr/local/etc/php/conf.d/error_reporting.ini #xdebug error reporting config
      - ./data/php/mailHog.ini:/usr/local/etc/php/conf.d/mailHog.ini #route mail through mailhog container, can connect in a browser at localhost:8025
    hostname: erpdev2.levisrmlocal.com
    domainname: levisrmlocal.com
    ports:
      - 80:80
      - 443:443
    working_dir: /var/www/html
    depends_on:
      - mysql
    restart: always

  mailhog:
    image: mailhog/mailhog
    container_name: mailhog-prism
    logging:
      driver: 'none'  # disable saving logs
    ports:
      - 1025:1025 # smtp server
      - 8025:8025 # web ui
    restart: always