version: '3.7'
services:
  phpdeps:
    image: prooph/composer:7.3
    volumes:
      - .:/app
    command: install
  assets:
    image: node:10
    volumes:
      - .:/usr/src/app
    working_dir: /usr/src/app
    command: bash -c "npm install && npm run watch"
  phpfpm:
    depends_on:
      - "phpdeps"
      - "assets"
    restart: on-failure
    build:
      context: .
      dockerfile: DockerfileDev
    image: searx-proxy:latest
    working_dir: /html
    volumes:
      - .:/html
  web:
    depends_on:
      - "phpfpm"
    image: searx-proxy:latest
    working_dir: /html
    command: nginx 
    volumes:
      - .:/html
      - ./config/nginx.conf:/etc/nginx/nginx.conf
      - ./config/nginx-default-dev.conf:/etc/nginx/sites-available/default
    ports: 
    - "8080:80"
