-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-scripts.sh
More file actions
executable file
·53 lines (51 loc) · 1.33 KB
/
docker-scripts.sh
File metadata and controls
executable file
·53 lines (51 loc) · 1.33 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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#!/bin/bash
# Docker Compose management script for Next.js app
case "$1" in
"start")
echo "Starting the application..."
docker-compose up -d
echo "Application started on http://localhost:3001"
;;
"stop")
echo "Stopping the application..."
docker-compose down
echo "Application stopped"
;;
"restart")
echo "Restarting the application..."
docker-compose restart
echo "Application restarted"
;;
"logs")
echo "Showing application logs..."
docker-compose logs -f app
;;
"build")
echo "Building the application..."
docker-compose build --no-cache
echo "Build completed"
;;
"status")
echo "Checking application status..."
docker-compose ps
;;
"clean")
echo "Cleaning up Docker resources..."
docker-compose down -v --remove-orphans
docker system prune -f
echo "Cleanup completed"
;;
*)
echo "Usage: $0 {start|stop|restart|logs|build|status|clean}"
echo ""
echo "Commands:"
echo " start - Start the application in detached mode"
echo " stop - Stop the application"
echo " restart - Restart the application"
echo " logs - Show application logs"
echo " build - Rebuild the Docker image"
echo " status - Show container status"
echo " clean - Clean up Docker resources"
exit 1
;;
esac