feat(deploy): add Docker full-stack deployment and server pack scripts

Enable one-click production deploy via docker-compose.prod.yml, with deployment docs and zip packaging for Baota upload.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-06-08 16:24:06 +08:00
parent 0d761db70b
commit e52cac7444
16 changed files with 673 additions and 2 deletions

25
docker/api/entrypoint.sh Normal file
View File

@@ -0,0 +1,25 @@
#!/bin/sh
set -e
cd /app/apps/api
echo "[api] running migrations..."
until npx prisma migrate deploy; do
echo "[api] waiting for database..."
sleep 2
done
npx prisma generate
if [ "$SEED_DATABASE" = "true" ]; then
echo "[api] seeding database..."
npx prisma db seed
fi
if [ -d /app/uploads-default/banners ] && [ ! -f /app/uploads/banners/welcome.svg ]; then
echo "[api] copying default banner uploads..."
mkdir -p /app/uploads/banners
cp -r /app/uploads-default/banners/. /app/uploads/banners/
fi
echo "[api] starting server..."
exec node dist/main.js