Move npm build to Docker image build time (#4636)
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -2,9 +2,16 @@
|
||||
|
||||
set -e
|
||||
|
||||
# setting api key
|
||||
VITE_SKYVERN_API_KEY=$(sed -n 's/.*cred\s*=\s*"\([^"]*\)".*/\1/p' .streamlit/secrets.toml)
|
||||
export VITE_SKYVERN_API_KEY
|
||||
npm run start
|
||||
# Extract API key from secrets file
|
||||
VITE_SKYVERN_API_KEY=$(sed -n 's/.*cred\s*=\s*"\([^"]*\)".*/\1/p' .streamlit/secrets.toml 2>/dev/null || echo "")
|
||||
|
||||
# Inject API key into pre-built JS files (replace placeholder)
|
||||
if [ -n "$VITE_SKYVERN_API_KEY" ]; then
|
||||
find /app/dist -name "*.js" -exec sed -i "s/__SKYVERN_API_KEY_PLACEHOLDER__/$VITE_SKYVERN_API_KEY/g" {} \;
|
||||
fi
|
||||
|
||||
# Start the servers (no rebuild needed)
|
||||
# Tini (configured as ENTRYPOINT) handles signal forwarding and zombie reaping
|
||||
node localServer.js &
|
||||
node artifactServer.js &
|
||||
wait
|
||||
|
||||
Reference in New Issue
Block a user