Complete stack
This commit is contained in:
34
run
Executable file
34
run
Executable file
@@ -0,0 +1,34 @@
|
||||
#!/bin/zsh
|
||||
|
||||
# Load parameters
|
||||
ACTION=$1
|
||||
ENV_FILE=".env"
|
||||
|
||||
# Check if .env file exists
|
||||
if [[ ! -f $ENV_FILE ]]; then
|
||||
echo "Error: $ENV_FILE file not found!"
|
||||
echo "Please create $ENV_FILE file with the following variables:"
|
||||
echo "DEV_URL=your.domain.com"
|
||||
echo "EXTERNAL_NETWORK=your_network_name"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Load environment variables
|
||||
source $ENV_FILE
|
||||
|
||||
case "$ACTION" in
|
||||
"up")
|
||||
docker network create $EXTERNAL_NETWORK > /dev/null 2>&1 || true
|
||||
docker compose up -d
|
||||
;;
|
||||
"restart")
|
||||
docker compose restart
|
||||
;;
|
||||
"down")
|
||||
docker compose down
|
||||
;;
|
||||
*)
|
||||
echo "Usage: $0 [up|restart|down]"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
Reference in New Issue
Block a user