Switch the user Docker build to the Montify Node serve style.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-09-09 18:29:16 +03:30
co-authored by Cursor
parent aa02802974
commit c6f13e1b38
5 changed files with 212 additions and 15 deletions
+34
View File
@@ -0,0 +1,34 @@
#!/bin/sh
load_env_file() {
file="$1"
[ -f "$file" ] || return 0
while IFS= read -r line || [ -n "$line" ]; do
case "$line" in
''|\#*) continue ;;
esac
key="${line%%=*}"
val="${line#*=}"
eval "current=\${$key-}"
if [ -z "$current" ]; then
export "$key=$val"
fi
done < "$file"
}
load_env_file /app/.env.production
load_env_file /app/.env
escape_sed() {
printf '%s\n' "$1" | sed -e 's/[\/&]/\\&/g' -e 's/\./\\\./g'
}
ESCAPED_API_BASE_URL=$(escape_sed "$VITE_API_BASE_URL")
if [ -d /app/dist ]; then
find /app/dist -type f \( -name "*.js" -o -name "*.html" \) -exec sed -i \
-e "s/__VITE_API_BASE_URL__/${ESCAPED_API_BASE_URL}/g" \
{} \;
fi
exec "$@"