server/entrypoint.sh

27 lines
555 B
Bash
Raw Normal View History

#!/bin/sh
# This script is a wrapper for the main server, CLI and Prisma binaries.
# Commands:
# - `start`: Starts the server
# - `cli`: Starts the CLI, sends all arguments to it
# Exit immediately if a command exits with a non-zero status.
set -euo
2024-04-07 13:38:17 +02:00
cd /app/dist
2024-04-07 10:56:15 +02:00
# Parse first argument
case "$1" in
"start")
2024-04-09 13:29:12 +02:00
NITRO_PORT=5173 bun run ./frontend/server/index.mjs & NODE_ENV=production bun run ./index.js --prod
;;
"cli")
# Start the CLI
shift 1
2024-04-07 13:34:21 +02:00
bun run ./cli.js "$@"
;;
*)
# Run custom commands
exec "$@"
;;
2024-04-07 13:37:00 +02:00
esac