diff --git a/docker-entrypoint.sh b/docker-entrypoint.sh index 590a487..7223c2d 100644 --- a/docker-entrypoint.sh +++ b/docker-entrypoint.sh @@ -9,22 +9,13 @@ echo "Checking database..." mkdir -p /app/data chmod 777 /app/data -# Create a dummy file to test write access -touch /app/data/.write_test 2>/dev/null && rm /app/data/.write_test || { - echo "Warning: Cannot write to /app/data, trying to fix permissions..." - chmod -R 777 /app/data -} - -# Use local prisma version from node_modules (skip generate - already built) -./node_modules/prisma/build/index.js db push --skip-generate || { - echo "Warning: db push failed, checking if database exists..." - if [ -f /app/data/dev.db ]; then - echo "Database file exists, continuing..." - else - echo "Database file does not exist and could not be created" - exit 1 - fi -} +# Only run db push if database file doesn't exist +if [ ! -f /app/data/dev.db ]; then + echo "Database not found, creating..." + ./node_modules/prisma/build/index.js db push --skip-generate +else + echo "Database already exists, skipping db push..." +fi echo "Starting application..." exec "$@"