-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup_chat.sh
39 lines (28 loc) · 992 Bytes
/
setup_chat.sh
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
#!/bin/bash
echo "Stopping all running Docker containers..."
if [ "$(docker ps -q)" ]; then
docker stop $(docker ps -q)
fi
echo "Removing all Docker containers..."
if [ "$(docker ps -a -q)" ]; then
docker rm $(docker ps -a -q)
fi
echo "Removing all Docker images..."
if [ "$(docker images -q)" ]; then
docker rmi $(docker images -q)
fi
echo "Removing Docker volumes..."
if [ "$(docker volume ls -q)" ]; then
docker volume rm $(docker volume ls -q)
fi
echo "Removing Docker networks..."
docker network rm $(docker network ls -q | grep -v "bridge\|host\|none")
echo "Cleaning up dangling Docker resources..."
docker system prune -f
echo "Environment cleanup complete."
echo "Installing Docker and Docker Compose..."
sudo apt-get update
sudo apt-get install -y docker-ce docker-ce-cli containerd.io docker-compose-plugin
echo "Building and starting the Docker containers..."
docker-compose up --build -d
echo "Setup complete. Docker container is running the project."