version: "3.1"
services:

  mysql:
    image: mysql:5.7
    container_name: mysql
    environment:
      MYSQL_DATABASE: 'partiushopcom_br'
      MYSQL_USER: 'partiushopcom_br'
      MYSQL_PASSWORD: 'iVpG=#w(GW5m'
      MYSQL_ROOT_PASSWORD: 'iVpG=#w(GW5m'
      MYSQL_ENTRYPOINT_INITDB: ./mysql/docker-entrypoint-initdb.d
    volumes:
      - ./app/db:/var/lib/mysql
      - ./data:/docker-entrypoint-initdb.d
    ports:
      - "3030:3306"

  phpmyadmin: 
    image: phpmyadmin/phpmyadmin
    links: 
      - mysql:db
    ports:
      - 8080:80
    environment: 
      MYSQL_USER: 'partiushopcom_br'
      MYSQL_PASSWORD: 'iVpG=#w(GW5m'
      MYSQL_ROOT_PASSWORD: 'iVpG=#w(GW5m'
  
  nginx:
    image: nginx:alpine
    container_name: nginx
    working_dir: /etc/nginx
    volumes:
      - ./app:/app
      - ./config/nginx:/etc/nginx/conf.d
    ports:
      - "80:80"
      - "443:443"
    depends_on:
      - php7.2
      # - php8.0

  php7.2:
    build:
      context: ./config/php7.2
      dockerfile: Dockerfile
    container_name: php7.2
    working_dir: /app
    volumes:
      - ./app:/app
      - ./config/php7.2/php-ini-overrides.ini:/usr/local/etc/php/conf.d/00-php.ini
      - ./bin/sendmail:/usr/local/bin/sendmail
    environment:
        PHP_IDE_CONFIG: serverName=localhost

#  php7.4:
#    build:
#      context: ./config/php7.4
#      dockerfile: Dockerfile
#    container_name: php7.4
#    working_dir: /app
#    volumes:
#      - ./app:/app
#      - ./config/php7.4/php-ini-overrides.ini:/usr/local/etc/php/conf.d/00-php.ini
#      - ./bin/sendmail:/usr/local/bin/sendmail
#    environment:
#        PHP_IDE_CONFIG: serverName=localhost

  # php8.0:
  #   build:
  #     context: ./config/php8.0
  #     dockerfile: Dockerfile
  #   container_name: php8.0
  #   working_dir: /app
  #   volumes:
  #     - ./app:/app
  #     - ./config/php8.0/php-ini-overrides.ini:/usr/local/etc/php/conf.d/00-php.ini
  #     - ./bin/sendmail:/usr/local/bin/sendmail
  #   environment:
  #       PHP_IDE_CONFIG: serverName=localhost
