ahoyapi: v2
commands:
  exec:
    cmd: docker compose exec ${LAKEDROPS_DEV_DC_OPTIONS} --user root php "$@"
    hide: true
  c:
    cmd: docker compose "$@"
    usage: Run docker compose
  b:
    cmd: docker compose build "$@"
    usage: Run docker compose build
  up:
    cmd: docker compose up -d --remove-orphans "$@"
    usage: Run docker compose up
  down:
    cmd: docker compose down "$@"
    usage: Run docker compose up
  ps:
    cmd: docker compose ps "$@"
    usage: Run docker compose ps
  logs:
    cmd: docker compose logs "$@"
    usage: Run docker compose logs
  stop:
    cmd: docker compose stop "$@"
    usage: Run docker compose stop
  start:
    cmd: docker compose start "$@"
    usage: Run docker compose start
  fs:
    cmd: |
      ahoy d4d exec chown -R www-data:www-data .
      ahoy d4d exec chmod -R g+w .
    usage: Open shell in the PHP container
  shell:
    cmd: ahoy d4d exec /bin/bash "$@"
    usage: Open shell in the PHP container
  update:
    cmd: |
      if [ -f settings/default/settings.php ]; then chmod +w settings/default/settings.php; fi
      composer lakedrops:docker4drupal
      if [ -f settings/default/settings.php ]; then chmod 444 settings/default/settings.php; fi
      echo "Pulling image updates..."
      docker compose pull --quiet
      ahoy d4d up
    usage: Update Docker4Drupal setup in project, pull images and start containers
