From 8f1068ac3135bcccf09374bc787ef22049b43461 Mon Sep 17 00:00:00 2001 From: JP Dillingham Date: Wed, 30 Dec 2020 21:16:50 -0600 Subject: copy files from example --- bin/build | 26 ++++++++++++++++++++++++++ bin/publish | 10 ++++++++++ bin/run | 14 ++++++++++++++ bin/start | 16 ++++++++++++++++ 4 files changed, 66 insertions(+) create mode 100644 bin/build create mode 100644 bin/publish create mode 100644 bin/run create mode 100644 bin/start (limited to 'bin') diff --git a/bin/build b/bin/build new file mode 100644 index 00000000..8b3470ad --- /dev/null +++ b/bin/build @@ -0,0 +1,26 @@ +#!/bin/bash +set -e + +# build web +cd web +pwd +npm install +npm run build + +# remove old build, but keep .gitkeep +rm -rf ../api/wwwroot +mkdir ../api/wwwroot +touch ../api/wwwroot/.gitkeep + +# copy new files +cp -r build/* ../api/wwwroot/ + +# publish api + web +cd ../api +pwd +dotnet publish --configuration Release + +# build docker +cd .. +pwd +docker build -t jpdillingham/slsk-web-example:latest . \ No newline at end of file diff --git a/bin/publish b/bin/publish new file mode 100644 index 00000000..c2e2faf6 --- /dev/null +++ b/bin/publish @@ -0,0 +1,10 @@ +#!/bin/bash +set -e + +cd api +pwd + +dotnet publish --configuration Release --self-contained --runtime win-x64 +dotnet publish --configuration Release --self-contained --runtime linux-x64 +dotnet publish --configuration Release --self-contained --runtime linux-arm +dotnet publish --configuration Release --self-contained --runtime osx-x64 \ No newline at end of file diff --git a/bin/run b/bin/run new file mode 100644 index 00000000..24d81890 --- /dev/null +++ b/bin/run @@ -0,0 +1,14 @@ +docker run -i \ + -p 5000:5000 \ + -p 50000:50000 \ + -v $SLSK_OUTPUT_DIR:/var/slsk/download \ + -v $SLSK_SHARED_DIR:/var/slsk/shared \ + -e "SLSK_USERNAME=$SLSK_USERNAME" \ + -e "SLSK_PASSWORD=$SLSK_PASSWORD" \ + -e "SLSK_LISTEN_PORT=50000" \ + -e "SLSK_ENABLE_DNET=true" \ + -e "SLSK_DNET_CHILD_LIMIT=10" \ + -e "SLSK_DIAGNOSTIC=Info" \ + -e "SLSK_CONNECT_TIMEOUT=5000" \ + -e "SLSK_INACTIVITY_TIMEOUT=15000" \ + jpdillingham/slsk-web-example:latest \ No newline at end of file diff --git a/bin/start b/bin/start new file mode 100644 index 00000000..949fa365 --- /dev/null +++ b/bin/start @@ -0,0 +1,16 @@ +docker run -d \ + -p 5000:5000 \ + -p 50000:50000 \ + -v $SLSK_OUTPUT_DIR:/var/slsk/download \ + -v $SLSK_SHARED_DIR:/var/slsk/shared \ + -e "SLSK_USERNAME=$SLSK_USERNAME" \ + -e "SLSK_PASSWORD=$SLSK_PASSWORD" \ + -e "SLSK_LISTEN_PORT=50000" \ + -e "SLSK_ENABLE_DNET=true" \ + -e "SLSK_DNET_CHILD_LIMIT=10" \ + -e "SLSK_DIAGNOSTIC=Info" \ + -e "SLSK_CONNECT_TIMEOUT=5000" \ + -e "SLSK_INACTIVITY_TIMEOUT=15000" \ + --name soulseek \ + --restart always \ + jpdillingham/slsk-web-example:latest \ No newline at end of file -- cgit v1.2.3