From 25885b8e08252db20f2a50e64184b6a59e546a73 Mon Sep 17 00:00:00 2001 From: fx Date: Fri, 13 Oct 2023 15:26:05 +0200 Subject: stuff --- .github/workflows/test.yml | 2 +- Dockerfile.build | 16 ++++++++++++++++ src/main.rs | 4 ++-- 3 files changed, 19 insertions(+), 3 deletions(-) create mode 100644 Dockerfile.build diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index c1bfdf7..bf170f5 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -54,4 +54,4 @@ jobs: push: true tags: | ghcr.io/fxqnlr/webol:dev-latest - ghcr.io/fxqnlr/webol:dev-${{ github.run_number }} \ No newline at end of file + ghcr.io/fxqnlr/webol:dev-${{ github.run_number }} diff --git a/Dockerfile.build b/Dockerfile.build new file mode 100644 index 0000000..3bbaf39 --- /dev/null +++ b/Dockerfile.build @@ -0,0 +1,16 @@ +FROM rust:1.73 as builder +WORKDIR /usr/src/webol +COPY . . +# RUN rustup target add armv7-unknown-linux-gnueabihf +# RUN apt update && apt install gcc-arm-linux-gnueabihf -y +# RUN CARGO_TARGET_ARMV7_UNKNOWN_LINUX_GNUEABIHF_LINKER=arm-linux-gnueabihf-gcc cargo install --path . --target armv7-unknown-linux-gnueabihf +RUN cargo install --path . + +# FROM --platform=arm64 debian:bullseye-slim +FROM debian:trixie-slim +# RUN apt-get update && apt-get install -y libc6 && rm -rf /var/lib/apt/lists/* +WORKDIR /usr/local/webol +COPY --from=builder /usr/local/cargo/bin/webol /usr/local/bin/webol + +EXPOSE 7229 +CMD ["webol"] diff --git a/src/main.rs b/src/main.rs index bb37dc2..e6c746c 100644 --- a/src/main.rs +++ b/src/main.rs @@ -51,7 +51,7 @@ async fn main() { .route("/device", post(post_device)) .with_state(shared_state); - // run it with hyper on localhost:3000 + // TODO: Add to config axum::Server::bind(&"0.0.0.0:3000".parse().unwrap()) .serve(app.into_make_service()) .await @@ -76,4 +76,4 @@ async fn init_db_pool() -> PgPool { info!("dbPool successfully connected to '{}'", db_url); pool -} \ No newline at end of file +} -- cgit v1.2.3