MusicPlayer/build_docker.sh

18 lines
588 B
Bash
Executable File

#!/bin/bash
echo Generate flutter release
flutter build web --dart-define API_URL="<<<API_URL>>>" --dart-define API_TOKEN="<<<API_TOKEN>>>" --source-maps
echo Build associated server
cd player-server && cargo build --release && cd ..
rm -rf image
mkdir image
cp -r build/web image
cp player-server/target/release/player-server image
echo Patch built files
sed -i 's/<\/head>/<script>window.flutterConfiguration = {canvasKitBaseUrl: "\/canvaskit\/"}<\/script><\/head>/g' image/web/index.html
echo Build Docker image
docker build image -f Dockerfile -t pierre42100/new_web_music_player