new script

This commit is contained in:
Andreas Knuth 2025-10-13 12:35:36 -05:00
parent 3cb11d71cf
commit f2cdde6d83
2 changed files with 23 additions and 4 deletions

23
manage-worker.sh Normal file
View File

@ -0,0 +1,23 @@
#!/bin/bash
# manage-worker.sh
DOMAIN=$1
ACTION=${2:-up -d} # Default: up -d
if [ -z "$DOMAIN" ]; then
echo "Usage: $0 <domain> [action]"
echo "Example: $0 andreasknuth.de"
echo " $0 andreasknuth.de down"
echo " $0 andreasknuth.de logs -f"
exit 1
fi
PROJECT_NAME="${DOMAIN//./-}"
ENV_FILE=".env.${DOMAIN}"
if [ ! -f "$ENV_FILE" ]; then
echo "Error: $ENV_FILE not found!"
exit 1
fi
docker compose -p "$PROJECT_NAME" --env-file "$ENV_FILE" $ACTION

View File

@ -1,4 +0,0 @@
#!/bin/bash
# start-worker.sh
DOMAIN=$1
docker compose -p ${DOMAIN//./-} --env-file $DOMAIN/.env up -d