-
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathdocker-entrypoint.sh
More file actions
27 lines (23 loc) · 944 Bytes
/
docker-entrypoint.sh
File metadata and controls
27 lines (23 loc) · 944 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/bin/sh
# ByteBox - Docker entrypoint
# Made with ❤️ by Pink Pixel
#
# Runs database migrations then starts the Next.js production server.
# Migrations are idempotent — already-applied ones are skipped automatically.
set -e
echo ""
echo " ╔══════════════════════════════╗"
echo " ║ ByteBox ║"
echo " ║ Made with ♥ by Pink Pixel ║"
echo " ╚══════════════════════════════╝"
echo ""
# Apply any pending Prisma migrations (safe to run on every startup)
echo "[bytebox] Running database migrations..."
npx prisma migrate deploy
echo "[bytebox] Migrations complete."
echo ""
# Start the Next.js production server
echo "[bytebox] Starting server on port ${PORT:-3000}..."
exec node node_modules/next/dist/bin/next start \
-p "${PORT:-3000}" \
-H "${HOSTNAME:-0.0.0.0}"