Update docker scripts for testing

This commit is contained in:
NGnius (Graham) 2022-09-01 16:39:34 -04:00
parent cac38d9809
commit b7b50d1104
4 changed files with 26 additions and 5 deletions

12
backend/build-docker.sh Normal file → Executable file
View file

@ -1,5 +1,15 @@
#!/bin/bash
$HOME/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/bin/cargo build --release
echo "--- Rust version info ---"
rustup --version
rustc --version
cargo --version
echo "--- Building plugin backend ---"
cargo build --release
mkdir -p out
cp target/release/fantastic-rs out/backend
echo " --- Cleaning up ---"
# remove root-owned target folder
cargo clean

View file

@ -1,5 +1,5 @@
#!/bin/bash
cross build --release
mkdir out
cp ./target/release/fantastic-rs out/backend
cargo build --target x86_64-unknown-linux-musl --release
mkdir -p ../bin
cp ./target/x86_64-unknown-linux-musl/release/fantastic-rs ../bin/backend

4
backend/create_docker_img.sh Executable file
View file

@ -0,0 +1,4 @@
#!/bin/bash
# build docker container locally (for testing)
docker build -t fantastic_backend .

7
backend/run_docker_img.sh Executable file
View file

@ -0,0 +1,7 @@
#!/bin/bash
# run docker container locally (for testing)
# assumes you're running in the backend/ dir of the project
docker run -i --entrypoint /backend/entrypoint.sh -v $PWD:/backend fantastic_backend
mkdir -p ../bin
cp ./out/backend ../bin