#!/bin/bash
if [ "$1" == "" ] ; then
    printf "\nDocker image-a version param missing"
    printf "\n\nSyntax:\n\n    deploy-standalone.sh 1.0.0\n\n"
    exit 1
fi

printf "\nBUILD START ...\n\n"

IMAGE_VERSION=$1
COMPOSE_FILE="docker-compose-standalone.yaml"

echo "Deploying with image version: $IMAGE_VERSION"

# Pass IMAGE_VERSION env var for compose variable substitution
IMAGE_VERSION="$IMAGE_VERSION" docker compose \
    -f "$COMPOSE_FILE" \
    up -d