version: '3'
services:

  nginx:
    image: nginx:latest
    ports:
      - "3000:80"
    volumes:
      - ./config/nginx.conf:/etc/nginx/conf.d/default.conf
      - .:/var/www
    depends_on:
      - mysql
      - web

  web:
    build:
      context: .
      dockerfile: ./config/Dockerfile
    ports:
      - 9000:9000
    volumes:
      - .:/var/www
    depends_on:
      - mysql
    environment:
      DB_HOST: mysql
      DB_PORT: port 
      DB_DATABASE: test
      DB_USER: user
      DB_PASSWORD: pass
      APP_ENV: development

  mysql:
    image: mysql:latest
    container_name: my-mysql-container
    environment:
      MYSQL_ROOT_PASSWORD: pass
      MYSQL_DATABASE: test
      MYSQL_USER: user
      MYSQL_PASSWORD: pass
    ports:
      - "3307:3306"