version: "2.4"
services:
  base:
    environment:
      - COMPOSER_PROCESS_TIMEOUT=1200
    image: mobicoop/php-node-chromium:2.0.0
    volumes:
      - ./:/var/www:delegated
      - ./build/cache:/root/.cache/:delegated
    working_dir: /var/www
    networks:
      - mobicoop_platform
  install:
    extends:
      service: base
    command: npm i
  install-all:
    extends:
      service: base
    command: npm run install-all
  fixtures:
    extends:
      service: base
    working_dir: /var/www/api
    entrypoint: bash entrypoint.sh
  fixtures-client:
    extends:
      service: base
    working_dir: /var/www/client
    entrypoint: bash entrypoint.sh
  db-diff:
    extends:
      service: base
    working_dir: /var/www/api
    command: php bin/console doctrine:migrations:diff -n -v
  db-migrate:
    extends:
      service: base
    working_dir: /var/www/api
    command: php bin/console doctrine:migrations:migrate -n -v
  db-fixtures-basic:
    extends:
      service: base
    working_dir: /var/www/api
    command: php bin/console doctrine:fixtures:load -n -v --append --group=basic
  db-fixtures-solidary:
    extends:
      service: base
    working_dir: /var/www/api
    command: php bin/console doctrine:fixtures:load -n -v --append --group=solidary
  app-geography-territory-link-batch:
    extends:
      service: base
    working_dir: /var/www/api
    command: php bin/console app:geography:territory-link-batch
  app-carpool-proof-batch:
    extends:
      service: base
    working_dir: /var/www/api
    command: php bin/console app:carpool:proof-batch

networks:
  mobicoop_platform:
    name: mobicoop_platform
