#!/bin/sh

# Check and create volumes if they don't exist
create_volume() {
    docker volume inspect $1 > /dev/null 2>&1
    if [ $? -eq 0 ]; then
        echo "Volume '$1' already exists."
    else
        docker volume create --name=$1
        echo "Volume '$1' created."
    fi
}

create_volume svndata
create_volume dbdata
create_volume dbconfig
create_volume wasconfig
create_volume data
create_volume wardata
create_volume securedb

# Build Docker image with explicit build context and Dockerfile path
docker build -t docker_all_os .

# Run Docker Compose with a specific container name
docker-compose up -d
