version: "3.8"
services:
  db:
    image: mysql
    restart: always
    ports:
      - '3307:3306'
    volumes:
      - db-data:/var/lib/mysql
      - ./db_backup:/var/backups/mysql
    environment:
      MYSQL_ALLOW_EMPTY_PASSWORD: 'yes'

  pma:
    image: phpmyadmin
    restart: always
    depends_on:
      - db
    ports:
      - "9000:80"
    environment:
      PMA_HOST: db
      UPLOAD_LIMIT: 1G

  maildev:
    image: maildev/maildev
    restart: always
    command: bin/maildev --web 80 --smtp 25 --hide-extensions STARTTLS
    ports:
      - '9001:80'
      - '25:25'
  www:
    build:
      context: php
      dockerfile: Dockerfile
    image: appeweb/php-7.4-symfony
    restart: always
    ports:
      - '8000:80'
      - '8080:8080'
    volumes:
      - ./php/vhosts:/etc/apache2/sites-enabled
      - ./:/var/www/project:rw

  composer:
    image: composer
    command: ["composer", "install"]
    volumes:
      - ./:/app

  yarn:
    image: node
    user: "node"
    working_dir: /home/node/app
    command: ["yarn", "install"]
    volumes:
      - ./:/home/node/app

#networks:
#  dev:

volumes:
  db-data:
