xonecas.io
53129
Pa

PAT / commit 94077a5

feat: add a command to stop the docker containers

xonecas2025-12-17 94077a516e87d644713258c2f26607dd6ac08727 parent 6299794

2 files changed

package.json+2−1
@@ -15,7 +15,8 @@
1515 "db:generate": "drizzle-kit generate",
1616 "db:migrate": "drizzle-kit migrate",
1717 "db:studio": "drizzle-kit studio",
18- "start:docker": "./scripts/start-docker.sh"
18+ "start:docker": "./scripts/start-docker.sh",
19+ "stop:docker": "./scripts/stop-docker.sh"
1920 },
2021 "dependencies": {
2122 "@googleapis/customsearch": "^7.0.1",
scripts/stop-docker.sh+23−0
@@ -0,0 +1,23 @@
1+#!/usr/bin/env bash
2+set -euo pipefail
3+
4+# Stop Valkey container if it exists
5+if docker ps -a --format '{{.Names}}' | grep -q '^valkey$'; then
6+ echo "Stopping Valkey container..."
7+ docker stop valkey
8+ echo "Valkey container stopped."
9+else
10+ echo "Valkey container not found."
11+fi
12+
13+# Stop PostgreSQL container if it exists
14+if docker ps -a --format '{{.Names}}' | grep -q '^postgres$'; then
15+ echo "Stopping PostgreSQL container..."
16+ docker stop postgres
17+ echo "PostgreSQL container stopped."
18+else
19+ echo "PostgreSQL container not found."
20+fi
21+
22+echo "Docker containers stopped successfully!"
23+