-
Notifications
You must be signed in to change notification settings - Fork 61
Expand file tree
/
Copy pathrebuild.sh
More file actions
executable file
·39 lines (39 loc) · 1.25 KB
/
rebuild.sh
File metadata and controls
executable file
·39 lines (39 loc) · 1.25 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#!/usr/bin/env bash
#
# Rebuild and restart all Docker services from scratch.
#
# What it does:
# 1. Stops all running containers for this project
# 2. Removes stale containers that may conflict (from other PlanExe repos)
# 3. Rebuilds all images without cache (picks up code changes)
# 4. Cleans up old images and build cache to prevent disk bloat
# 5. Starts everything back up
#
# Your database is safe — data lives in the Docker volume
# "planexe_database_postgres_data", which is never removed by this script.
#
# Usage:
# ./rebuild.sh
#
set -e
docker compose down --remove-orphans
# Remove stopped containers whose names conflict with this project.
# Data is safe — it lives in Docker volumes, not containers.
docker rm \
database_postgres \
database_worker \
worker_plan \
worker_plan_database \
worker_plan_database_1 \
worker_plan_database_2 \
worker_plan_database_3 \
frontend_multi_user \
mcp_cloud \
2>&1 | grep -v "No such container" || true
docker compose build --no-cache
# Clean up dangling images and build cache left by --no-cache rebuilds.
# This prevents disk usage from growing with every rebuild.
# Volumes are NOT touched — data is safe.
docker image prune -f
docker builder prune -f
docker compose up