Skip to content

Commit

Permalink
Update docker startup script
Browse files Browse the repository at this point in the history
Signed-off-by: draco <dracode01@gmail.com>
  • Loading branch information
dracoooooo committed Apr 7, 2024
1 parent ad34c91 commit 1a7d89c
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions run.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
#!/bin/bash

# Check if the environment variable VITE_BACKEND_URL is set
if [ -z "${VITE_BACKEND_URL}" ]; then
echo "VITE_BACKEND_URL is not set. Default to http://127.0.0.1:8000/"
else
# Replace the backend url with VITE_BACKEND_URL
echo "VITE_BACKEND_URL is set to ${VITE_BACKEND_URL}"

# Find and replace in index-*.js files within /app/dist/asserts/
find /app/dist/asserts/ -type f -name 'index-*.js' -exec sed -i "s|http://127.0.0.1:8000/|$VITE_BACKEND_URL|g" {} \;

echo "Backend url replacement complete."
fi


# Start the frontend process
http-server dist &

Expand Down

0 comments on commit 1a7d89c

Please sign in to comment.