SpaceNinjaServer/docker-entrypoint.sh
Animan8000 562ddd513f
Some checks failed
Build / build (push) Has been cancelled
Build Docker image / docker (push) Has been cancelled
chore: update docker stuff (#1961)
Some Docker stuff I updated ~~but keeping WIP for now, until I know whether this breaks or not, if someone could test it for me. Will close the PR if it doesn't, cuz if I cannot even run it on my machine (Docker only crashing on my end in general), then its pointless for me to mess with it.~~

Reviewed-on: #1961
Co-authored-by: Animan8000 <animan8000@noreply.localhost>
Co-committed-by: Animan8000 <animan8000@noreply.localhost>
2025-05-02 15:06:36 -07:00

25 lines
641 B
Bash
Executable File

#!/bin/bash
set -e
# Set up the configuration file using environment variables.
echo '{
"logger": {
"files": true,
"level": "trace",
"__valid_levels": "fatal, error, warn, info, http, debug, trace"
}
}
' > config.json
for config in $(env | grep "APP_")
do
var=$(echo "${config}" | tr '[:upper:]' '[:lower:]' | sed 's/app_//g' | sed -E 's/_([a-z])/\U\1/g' | sed 's/=.*//g')
val=$(echo "${config}" | sed 's/.*=//g')
jq --arg variable "$var" --arg value "$val" '.[$variable] += try [$value|fromjson][] catch $value' config.json > config.tmp
mv config.tmp config.json
done
npm i --omit=dev
npm run build
exec npm run start