This repository has been archived on 2026-08-19. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
maple-brief-aggregator/entrypoint.sh
T

28 lines
674 B
Bash

#!/bin/sh
# MapleBrief entrypoint
# 1) First boot: seed /data with the clean migrated DB + write privileged key if provided
# 2) Start Next standalone server
set -e
cd /app
DB="${DATABASE_URL#file:}"
[ -n "$DB" ] || DB=/data/dev.db
# Export an absolute DATABASE_URL for the Node/Prisma process (relative
# paths resolve against the schema dir and can point at the wrong file).
case "$DB" in
/*) ;;
*) DB="/$DB" ;;
esac
export DATABASE_URL="file:$DB"
if [ ! -f "$DB" ]; then
# create parent dir (volume may be fresh)
DIR="$(dirname "$DB")"
mkdir -p "$DIR"
cp ./seed-dev.db "$DB"
echo "[entrypoint] initialized $DB from seed snapshot"
fi
exec node server.js