We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent f646fbc commit 84350e3Copy full SHA for 84350e3
1 file changed
rel/overlays/bin/docker-entrypoint.sh
@@ -1,6 +1,26 @@
1
#!/bin/sh
2
set -e
3
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
24
echo "Running migrations..."
25
/app/bin/migrate
26
0 commit comments