fixes
This commit is contained in:
28
start.sh
28
start.sh
@@ -1,14 +1,28 @@
|
|||||||
#!/bin/bash
|
#!/bin/sh
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
# Start Next.js admin panel in background on port 3000
|
cd /app
|
||||||
HOSTNAME="0.0.0.0" PORT=3000 node /app/server.js &
|
|
||||||
|
|
||||||
# Optional: small log so you know it started
|
echo "Contents of /app:"
|
||||||
echo "Started Next.js admin on :3000" >&2
|
ls
|
||||||
|
|
||||||
# Wait a bit so proxy doesn't hit it before it's listening
|
if [ ! -f server.js ]; then
|
||||||
|
echo "ERROR: /app/server.js not found. Check your Docker COPY paths."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "Starting Next.js admin on :3000..."
|
||||||
|
HOSTNAME="0.0.0.0" PORT=3000 NODE_ENV=production node server.js &
|
||||||
|
NODE_PID=$!
|
||||||
|
|
||||||
|
# Give Next.js a moment to boot
|
||||||
sleep 3
|
sleep 3
|
||||||
|
|
||||||
# Start Go API (uses PORT env from Dokku, defaults to 5000)
|
# If Node crashed immediately, bail out so you can see the logs
|
||||||
|
if ! kill -0 "$NODE_PID" 2>/dev/null; then
|
||||||
|
echo "ERROR: Next.js server process exited. Check logs above for stack trace."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "Starting Go API on :${PORT:-5000}..."
|
||||||
exec /app/api
|
exec /app/api
|
||||||
|
|||||||
Reference in New Issue
Block a user