#!/usr/bin/env bash
set -euo pipefail
cd "$(dirname "$0")/.."

if [[ ! -f chatwoot/docker/Dockerfile ]]; then
  echo "Run ./scripts/download-source.sh first."
  exit 1
fi

# shellcheck disable=SC1091
source "$(dirname "$0")/lib-compose.sh"

echo "Building Chatwoot Docker image from local source (this takes a while)..."
compose build rails sidekiq
echo "Done. Image: qiyasy-chatwoot-local:develop"
