#!/bin/bash
export UserID=$(id -u)
export GroupID=$(id -g)

_command="docker-compose"

if [ "$1" == "up" ]; then
    bash -c "$_command up -d ${@:2}"
elif [ "$1" == "ps" ]; then
    bash -c "$_command ps"
elif [ "$1" == "down" ]; then
    bash -c "$_command down --remove-orphans"
elif [ "$1" == "a" ]; then
    docker-compose exec php php artisan "${@:2}"
elif [ "$1" == "c" ]; then
    docker-compose exec php composer "${@:2}"
elif [ "$1" == "php" ]; then
    docker-compose exec php php "${@:2}"
elif [ "$1" == "npm" ]; then
    docker-compose run --rm npm npm "${@:2}"
elif [ "$1" == "node" ]; then
    docker-compose run --rm npm node "${@:2}"
else
    docker-compose run --rm php "${@}"
fi

