-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Ok shit seems to be working. TODO: deployment - use cargo-run-bin to manage installation of some devel tools - switch to stable toolchain (requires code changes in app)
- Loading branch information
Showing
29 changed files
with
270 additions
and
256 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
from rust:bookworm as build-base | ||
|
||
run mkdir /work | ||
workdir /work | ||
|
||
# install build tools tools | ||
run curl -L --proto '=https' --tlsv1.2 -sSf https://raw.githubusercontent.com/cargo-bins/cargo-binstall/main/install-from-binstall-release.sh | bash | ||
run cargo binstall -y cargo-run-bin | ||
copy Cargo.toml Cargo.lock . | ||
run cargo bin --install | ||
run rustup target add wasm32-unknown-unknown | ||
|
||
from build-base as build-docs | ||
|
||
copy docs docs | ||
workdir /work/docs | ||
run cargo bin mdbook build | ||
|
||
from build-base as build-deps | ||
|
||
copy models models | ||
copy server/Cargo.toml server/ | ||
|
||
workdir /work/app | ||
copy app/Cargo.toml app/Trunk.toml app/index.html app/tailwind.config.js app/tailwind.css . | ||
copy app/assets assets | ||
run mkdir src && echo "fn main() {}" > src/main.rs | ||
run cargo bin trunk build --release | ||
|
||
workdir /work/server | ||
run mkdir src && echo "fn main() {}" > src/main.rs && touch src/lib.rs | ||
run cargo build --release --bin buenzlimarks | ||
|
||
from build-deps as build-app | ||
|
||
workdir /work/app | ||
copy app/src src | ||
run touch src/main.rs && cargo bin trunk build --release | ||
|
||
from build-deps as build-server | ||
|
||
workdir /work/server | ||
copy server/src src | ||
run touch src/main.rs src/lib.rs && cargo build --release --bin buenzlimarks | ||
|
||
from debian:bookworm-slim | ||
|
||
# expected by tokio::signal::ctrl_c | ||
stopsignal SIGINT | ||
|
||
copy --from=build-docs /work/target/docs /docs | ||
copy --from=build-app /work/target/app /app | ||
copy --from=build-server /work/target/release/buenzlimarks /usr/local/bin/ | ||
|
||
cmd [ "/usr/local/bin/buenzlimarks" ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,8 @@ | ||
[build] | ||
dist = "../target/app" | ||
|
||
[serve] | ||
port = 3000 | ||
proxy_backend = "http://localhost:4000/api" | ||
|
||
[[proxy]] | ||
backend = "http://localhost:4000/api" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.