-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun-docker.sh
More file actions
executable file
·47 lines (43 loc) · 1.61 KB
/
run-docker.sh
File metadata and controls
executable file
·47 lines (43 loc) · 1.61 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
#!/bin/bash
# Run script for Tribes Game Docker container
echo "Starting Tribes Game server..."
# Stop existing container if it exists
docker stop tribes-server 2>/dev/null
docker rm tribes-server 2>/dev/null
# Run the container with volume mounts for persistence
docker run -d \
--name tribes-server \
-p 0.0.0.0:8000:8000 \
-v $(pwd)/tribe-data/bear:/app/tribe-data/bear \
-v $(pwd)/tribe-data/flounder:/app/tribe-data/flounder \
-v $(pwd)/tribe-data/bug:/app/tribe-data/bug \
-v $(pwd)/tribe-data/vashon:/app/tribe-data/vashon \
-v $(pwd)/tribe-data/mib:/app/tribe-data/mib \
-v $(pwd)/tribe-data/sloth:/app/tribe-data/sloth \
-v $(pwd)/tribe-data/wolf:/app/tribe-data/wolf \
-v $(pwd)/tribe-data/users.json:/app/tribe-data/users.json \
-v $(pwd)/archive:/app/archive \
-v $(pwd)/logs:/app/logs \
--restart unless-stopped \
tribes-game:latest
if [ $? -eq 0 ]; then
echo "✅ Tribes server started successfully!"
echo ""
echo "🌐 Local access:"
echo " Game interface: http://localhost:8000"
echo " Health check: http://localhost:8000/health"
echo ""
echo "🌐 Network access (share with others):"
echo " Game interface: http://$(hostname | awk '{print $1}'):8000"
echo " Health check: http://$(hostname | awk '{print $1}'):8000/health"
echo ""
echo "📊 To view logs: docker logs -f tribes-server"
echo "⏹️ To stop: docker stop tribes-server"
echo ""
echo "Checking server status..."
sleep 5
curl -s http://localhost:8000/health | jq '.' 2>/dev/null || echo "Server starting up..."
else
echo "❌ Failed to start server!"
exit 1
fi