Update db-backup-standalone.sh to use docker compose

- Replace docker service scale with docker compose stop/start
- Update service name from utility-bills-tracker_mongo to mongo
- Reference docker-compose-standalone.yaml compose file
- Update comments to reflect container operations vs swarm service

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Knee Cola
2025-11-25 19:25:51 +01:00
parent 7f087b8e10
commit c1686c4cb8
3 changed files with 6 additions and 5 deletions

View File

@@ -2,10 +2,11 @@
set -euo pipefail set -euo pipefail
# Configuration # Configuration
MONGO_SERVICE="utility-bills-tracker_mongo" MONGO_SERVICE="mongo"
COMPOSE_FILE="docker-compose-standalone.yaml"
# scale down mongo service while we copy its volume # stop mongo container while we copy its volume
docker service scale "$MONGO_SERVICE"=0 docker compose -f "$COMPOSE_FILE" stop "$MONGO_SERVICE"
# timestamp for filename # timestamp for filename
TIMESTAMP=$(date +"%Y-%m-%d-%H-%M") TIMESTAMP=$(date +"%Y-%m-%d-%H-%M")
@@ -32,5 +33,5 @@ if [ "$KEEP" -gt 0 ]; then
fi fi
fi fi
# bring mongo service back up # bring mongo container back up
docker service scale "$MONGO_SERVICE"=1 docker compose -f "$COMPOSE_FILE" start "$MONGO_SERVICE"