server/entrypoint.sh

27 lines
500 B
Bash
Raw Permalink 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 -eu
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")
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