version: "2.1"

services:

  phpfpm:
    build:
      context: ./docker/phpfpm
    networks:
      - openclassrooms_course
    working_dir: /var/www/openclassrooms_course
    volumes:
      - ./:/var/www/openclassrooms_course
      - ./docker/phpfpm/php.timezone.ini:/usr/local/etc/php/conf.d/timezone.ini

  nginx:
    build:
      context: ./docker/nginx
    networks:
      - openclassrooms_course
    ports:
      - "8080:80"
    volumes:
      - ./docker/nginx/symfony3.conf:/etc/nginx/conf.d/symfony3.conf
    volumes_from:
      - phpfpm

  mysql:
    image: mysql:8.0.1
    expose:
      - 3306
    ports:
      - "3306:3306"
    environment:
      - MYSQL_ROOT_PASSWORD=admin
      - MYSQL_DATABASE=oc_advertising
    volumes:
      - mysql_data:/var/lib/mysql

  phpmyadmin:
    image: nazarpc/phpmyadmin
    ports:
      - "1234:80"
    links:
      - mysql:mysql

  composer:
    build:
      context: ./docker/composer

volumes:
  phpfpm:
    driver: local
  nginx:
    driver: local
  mysql_data:
    driver: local

networks:
  openclassrooms_course:
    driver: bridge
version: "2.1"

services:

  phpfpm:
    build:
      context: ./docker/phpfpm
    networks:
      - openclassrooms_course
    working_dir: /var/www/openclassrooms_course
    volumes:
      - ./:/var/www/openclassrooms_course
      - ./docker/phpfpm/php.timezone.ini:/usr/local/etc/php/conf.d/timezone.ini

  nginx:
    build:
      context: ./docker/nginx
    networks:
      - openclassrooms_course
    ports:
      - "8080:80"
    volumes:
      - ./docker/nginx/symfony3.conf:/etc/nginx/conf.d/symfony3.conf
    volumes_from:
      - phpfpm

  mysql:
    image: mysql:8.0.1
    networks:
      - openclassrooms_course
    expose:
      - 3306
    ports:
      - "3306:3306"
    environment:
      - MYSQL_ROOT_PASSWORD=admin
      - MYSQL_DATABASE=oc_advertising
    volumes:
      - mysql_data:/var/lib/mysql

  phpmyadmin:
    image: nazarpc/phpmyadmin
    networks:
      - openclassrooms_course
    ports:
      - "1234:80"
    links:
      - mysql:mysql

  composer:
    build:
      context: ./docker/composer

volumes:
  phpfpm:
    driver: local
  nginx:
    driver: local
  mysql_data:
    driver: local

networks:
  openclassrooms_course:
    driver: bridge
Add network to mysql and phpmyadmin containers.
Add network to mysql and phpmyadmin containers.
