version: '3.4'

services:
  mysql-service:
    container_name: gss-mysql5.7.32
    image: mysql/mysql-server:5.7.32
    volumes:
      - gss-data:/var/lib/mysql
      - ./../dumps:/dumps
    logging:
      driver: "none"
    # command: mysqld --sql_mode="STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION"
    ports:
      - '3306:3306'
    environment:
      MYSQL_USER: 'gssUser'
      MYSQL_PASSWORD: 'gssDb123!'
      MYSQL_ROOT_PASSWORD: 'gssRoot123!'
      MYSQL_DATABASE: 'gss_price_updater'
  phpmyadmin:
      container_name: phpmyadmin
      image: phpmyadmin/phpmyadmin
      depends_on:
        - mysql-service
      ports:
        - '5050:80'
      environment:
        PMA_HOST: mysql-service
        PMA_PORT: 3306
        UPLOAD_LIMIT: 300M
  gss-service:
      container_name: gss-app
      # NOTE: BUILD DIRECTORY NAME SHOULD BE CORRECT, check the name of the directory of the clone repository
      build: ./../src
      volumes: 
        - ./../src:/var/www/html
      ports:
        - '80:80'
      depends_on:
        - mysql-service
        - phpmyadmin
volumes:
  gss-data:
    external: true