Skip to content

Commit 84350e3

Browse files
committed
Update docker entrypoint
1 parent f646fbc commit 84350e3

1 file changed

Lines changed: 20 additions & 0 deletions

File tree

rel/overlays/bin/docker-entrypoint.sh

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,26 @@
11
#!/bin/sh
22
set -e
33

4+
# Extract the directory path from DATABASE_PATH
5+
DB_DIR=$(dirname "$DATABASE_PATH")
6+
7+
# Create database directory if it doesn't exist
8+
echo "Ensuring database directory exists..."
9+
mkdir -p "$DB_DIR"
10+
11+
# Create an empty SQLite database file if it doesn't exist
12+
echo "Ensuring database file exists..."
13+
if [ ! -f "$DATABASE_PATH" ]; then
14+
touch "$DATABASE_PATH"
15+
fi
16+
17+
# Ensure proper permissions for both directory and database file
18+
echo "Setting proper permissions..."
19+
chown -R nobody:root "$DB_DIR"
20+
chown nobody:root "$DATABASE_PATH"
21+
chmod 755 "$DB_DIR"
22+
chmod 644 "$DATABASE_PATH"
23+
424
echo "Running migrations..."
525
/app/bin/migrate
626

0 commit comments

Comments
 (0)