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>
		
			
				
	
	
		
			25 lines
		
	
	
		
			641 B
		
	
	
	
		
			Bash
		
	
	
		
			Executable File
		
	
	
	
	
			
		
		
	
	
			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
 |