Files
baserow/web-frontend/docker/docker-entrypoint-prod.sh
Davide Silvestri 21cc8ddc09 fix: re-add docker-entrypoint in the web-frontend image for backward compatibility (#4908)
* Re-add docker-entrypoint in the web-frontend image for backward compatibility

* address copilot feedback

* Add changelog entry
2026-03-04 14:14:17 +01:00

30 lines
1022 B
Bash

#!/bin/bash
# Production entrypoint for the web-frontend container.
# Starts the Nitro/Nuxt production server when no command is given or when a
# known legacy command is used. Otherwise, executes the provided command so the
# image remains usable for one-off commands and debugging.
set -euo pipefail
start_server() {
exec node --import ./env-remap.mjs .output/server/index.mjs
}
# No command provided: start the server.
if [[ $# -eq 0 ]]; then
start_server
fi
# Catch legacy commands that were used in v2.0 and before to start the
# production server (nuxt, nuxt-local) and redirect them to the new Nitro
# server. This ensures backward compatibility with custom docker-compose or
# helm charts that still override the container command.
case "$1" in
nuxt*)
echo "WARNING: legacy command '$1' detected. Starting the Nuxt/Nitro server instead. You can safely remove the 'command' override from your docker-compose file." >&2
start_server
;;
*)
exec "$@"
;;
esac