mirror of
https://github.com/BarkProductions/barkman.git
synced 2026-06-13 06:11:55 +00:00
Add docker build file for UI and associated Actions workflow
This commit is contained in:
@@ -0,0 +1,6 @@
|
||||
http://* {
|
||||
root * /app
|
||||
encode
|
||||
try_files {path} /index.html
|
||||
file_server
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
#!/bin/sh
|
||||
# Generate sed script file
|
||||
sed_script="/tmp/sed_script.sed"
|
||||
> "$sed_script"
|
||||
|
||||
# Ensure the sed script file is cleaned up on exit
|
||||
trap 'rm -f "$sed_script"' EXIT
|
||||
|
||||
# Extract VITE_ environment variables and build the sed expression
|
||||
env | grep '^VITE_' | while IFS='=' read -r key value; do
|
||||
# Escape slashes and other special characters in key and value
|
||||
escaped_key=$(printf '%s' "$key" | sed 's/[\/&]/\\&/g')
|
||||
escaped_value=$(printf '%s' "$value" | sed 's/[\/&]/\\&/g')
|
||||
# Append to sed script file
|
||||
echo "s|${escaped_key}|${escaped_value}|g;" >> "$sed_script"
|
||||
done
|
||||
|
||||
# Check if the sed script file was created and is not empty
|
||||
if [ ! -s "$sed_script" ]; then
|
||||
echo "No VITE_ environment variables found. Exiting with error."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# sed All files
|
||||
find /app -type f -exec sed -i -f "$sed_script" '{}' +
|
||||
|
||||
caddy run --config /etc/caddy/Caddyfile --adapter caddyfile
|
||||
Reference in New Issue
Block a user