-
Notifications
You must be signed in to change notification settings - Fork 23
Expand file tree
/
Copy pathentrypoint.sh
More file actions
25 lines (21 loc) · 768 Bytes
/
entrypoint.sh
File metadata and controls
25 lines (21 loc) · 768 Bytes
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
#!/bin/bash
set -e
IMAGE_DATABASE_FILE_PATH="/app/docker-compose/players-sqlite3.db"
VOLUME_DATABASE_FILE_PATH="/sqlite3-db/players-sqlite3.db"
echo "✔ Starting container..."
if [ ! -f "$VOLUME_DATABASE_FILE_PATH" ]; then
echo "⚠️ No existing database file found in volume."
if [ -f "$IMAGE_DATABASE_FILE_PATH" ]; then
echo "Copying database file to writable volume..."
cp "$IMAGE_DATABASE_FILE_PATH" "$VOLUME_DATABASE_FILE_PATH"
echo "✔ Database initialized at $VOLUME_DATABASE_FILE_PATH"
else
echo "⚠️ Database file missing at $IMAGE_DATABASE_FILE_PATH"
exit 1
fi
else
echo "✔ Existing database file found. Skipping seed copy."
fi
echo "✔ Ready!"
echo "🚀 Launching app..."
exec "$@"