-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdockerizer.sh
More file actions
executable file
·34 lines (28 loc) · 1.18 KB
/
dockerizer.sh
File metadata and controls
executable file
·34 lines (28 loc) · 1.18 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
#!/bin/bash
echo "--- Stopping any previous containers... ---"
docker-compose -f docker-compose.yml down -v
if [ $? -ne 0 ]; then
echo "Warning: 'docker-compose down' failed. This might be the first run, which is okay. Continuing..."
fi
echo "--- Building and starting the application... ---"
docker-compose -f docker-compose.yml up --build -d
if [ $? -eq 0 ]; then
echo "--- Application is now running! ---"
echo "Access it at: http://localhost:6869"
echo "To stop the application, run: docker-compose -f docker-compose.yml down"
# === Try to launch Firefox with checks ===
sleep 3 # Wait a bit for the server to start
if [ -z "$DISPLAY" ]; then
echo "⚠️ No GUI detected (DISPLAY is not set). Cannot launch Firefox."
echo "💡 Open http://localhost:6869 manually in your browser."
elif ! command -v firefox &> /dev/null; then
echo "⚠️ Firefox is not installed."
echo "💡 Install it with: sudo apt install firefox"
else
echo "🚀 Launching Firefox..."
firefox http://localhost:6869 &
fi
else
echo "❌ Docker Compose failed. Check Docker is running and docker-compose.yml is correct."
exit 1
fi