deploy: Dockerfile, entrypoint, standalone output, dockerignore

This commit is contained in:
2026-08-15 18:11:41 -04:00
parent e709de01d4
commit cbea5e8fa4
4 changed files with 110 additions and 0 deletions
+27
View File
@@ -0,0 +1,27 @@
#!/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