File size: 1,030 Bytes
fe02ff1
 
 
 
 
 
cc771fe
fe02ff1
 
 
 
cc771fe
 
 
 
 
fe02ff1
 
 
 
cc771fe
 
 
 
 
fe02ff1
 
 
 
 
 
 
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
#!/bin/sh
set -e

echo "Starting GPU Leaderboard application..."

# Create data directory if it doesn't exist
mkdir -p /app/data || true
echo "Ensuring data directory exists: /app/data"

# Initialize data.json if it doesn't exist
if [ ! -f /app/data/data.json ]; then
  # Try to create the file, but don't fail if we can't
  echo '{}' > /app/data/data.json 2>/dev/null || echo "Warning: Could not create data.json, will use existing file if available"
  if [ -f /app/data/data.json ]; then
    echo "Initialized empty data.json file"
  fi
fi

# Initialize ips.json if it doesn't exist
if [ ! -f /app/data/ips.json ]; then
  # Try to create the file, but don't fail if we can't
  echo '{}' > /app/data/ips.json 2>/dev/null || echo "Warning: Could not create ips.json, will use existing file if available"
  if [ -f /app/data/ips.json ]; then
    echo "Initialized empty ips.json file"
  fi
fi

echo "Data files initialized successfully"
echo "Starting application with: $@"

# Execute the provided command (node start.js)
exec "$@"