version: '3'

services:

  app:
    build:
      context: ./
      dockerfile: app.Dockerfile
    working_dir: /var/www
    volumes:
      - ./:/var/www
    environment:
      DB_PORT: 3306
      DB_HOST: database

  web:
    build:
      context: ./
      dockerfile: web.Dockerfile
    working_dir: /var/www
    volumes:
      - ./:/var/www
    ports:
      - 8082:80

  database:
    image: mysql:5.7
    volumes:
      - dbdata:/var/lib/mysql
    environment:
      MYSQL_ROOT_PASSWORD: root
      MYSQL_DATABASE: odziez
    ports:
      - 3371:3306

volumes:
  dbdata: