services:
  nginx2:
    image: nginx:latest
    volumes:
      - ./:/var/www
      - ./_docker/nginx/conf.d/:/etc/nginx/conf.d
    ports:
      - 8876:80
    environment:
      - NGINX_HOST=localhost
      - NGINX_PORT=80
    container_name: andrew_nginx
    depends_on:
      - app
  app:
    build:
        context: .
        dockerfile: _docker/app/Dockerfile
    environment:
      - PHP_IDE_CONFIG=serverName=crm_app
    volumes:
      - ./:/var/www
    depends_on:
        - db
    container_name: andrew_app
  db:
    image: mysql:8.0
    restart: always
    volumes:
        - ./_docker/db/tmp:/var/lib/mysql
    environment:
        MYSQL_DATABASE: db_docker2
        MYSQL_ROOT_PASSWORD: root
    ports:
        - 8101:3306
    command: mysqld --character-set-server=utf8 --collation-server=utf8_unicode_ci
    container_name: andrew_db
  phpmyadmin:
      image: phpmyadmin/phpmyadmin
      environment:
          PMA_HOST: db
          MYSQL_ROOT_PASSWORD: root
      depends_on:
          - db
      ports:
          - 3001:80
