version: "3"
services:
  -nginx:
    container_name: "task-nginx"
    build:
      context: ./docker/nginx
    depends_on:
      - task-app
    ports:
      - 80:80
    volumes:
      - ./:/src

  task-app:
    container_name: "task-app"
    build:
      context: ./docker/php
    depends_on:
      - task-mysql
    volumes:
      - ./:/src
      - /src/node_modules
      - /src/vendor
      - ./docker/php/php.ini:/usr/local/etc/php/php.ini

  task-mysql:
    image: mysql:8.0.37
    command: --max_allowed_packet=32505856
    container_name: "task-mysql"
    volumes:
      - ./docker/mysql:/var/lib/mysql
    environment:
      - MYSQL_ROOT_PASSWORD=root
      - MYSQL_DATABASE=task
    ports:
      - 3306:3306

  task-redis:
    image: redis:alpine
    container_name: "task-redis"
    ports:
      - 16379:6379
