version: '3'

services:
  main:
    build:
      context: .
      dockerfile: Dockerfile
    depends_on:
      - composer
    command: 'php artisan serve --host=0.0.0.0'
    network_mode: "host"
    volumes:
      - ./:/app
      - ./docker-php-ram-limit.ini:/usr/local/etc/php/conf.d/docker-php-ram-limit.ini

  composer:
    image: composer
    working_dir: /app
    command: "composer install --no-scripts --ignore-platform-reqs"
    volumes:
      - ./:/app

  node:
    image: node:12-alpine
    working_dir: /app
    depends_on:
      - main
    volumes:
      - ./:/app
    command: ash -c "npm install && npm run local"