-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstart.sh
More file actions
67 lines (57 loc) · 1.72 KB
/
start.sh
File metadata and controls
67 lines (57 loc) · 1.72 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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
#!/bin/sh
# FileMorph one-click starter for Linux / macOS
set -e
echo ""
echo " ================================================================"
echo " FileMorph - File Converter & Compressor"
echo " ================================================================"
echo ""
# Check if Docker is running
if ! docker info > /dev/null 2>&1; then
echo " ERROR: Docker is not running."
echo ""
echo " Please start Docker and run this script again."
echo " Linux: sudo systemctl start docker"
echo " macOS: open Docker Desktop"
echo ""
exit 1
fi
echo " Docker is running. Starting FileMorph..."
echo ""
# Start the container
docker compose up -d --build
echo ""
echo " Waiting for FileMorph to be ready..."
# Poll until healthy (max ~2 minutes)
attempts=0
while true; do
attempts=$((attempts + 1))
if [ "$attempts" -gt 40 ]; then
echo ""
echo " Timeout: FileMorph did not start within 2 minutes."
echo " Check logs with: docker compose logs filemorph"
exit 1
fi
if docker compose ps filemorph 2>/dev/null | grep -q "healthy"; then
break
fi
sleep 3
done
echo " FileMorph is ready!"
echo ""
# Show API key if first run
echo " ================================================================"
docker compose logs --tail=30 filemorph 2>&1 | grep "API KEY" || true
echo " ================================================================"
echo ""
echo " Web UI: http://localhost:8000"
echo " API: http://localhost:8000/docs"
echo ""
echo " To stop FileMorph: docker compose down"
echo ""
# Open browser
if command -v xdg-open > /dev/null 2>&1; then
xdg-open http://localhost:8000
elif command -v open > /dev/null 2>&1; then
open http://localhost:8000
fi