From bace6b727dc7cd42bbe06b2f6cbb89a82d6bbeac Mon Sep 17 00:00:00 2001 From: Orual Date: Mon, 3 Nov 2025 21:58:07 -0500 Subject: [PATCH] dockerfile for server --- .dockerignore | 6 ++++++ Dockerfile | 35 +++++++++++++++++++++++++++++++++++ 2 files changed, 41 insertions(+) create mode 100644 .dockerignore create mode 100644 Dockerfile diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..8028734 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,6 @@ +**/target +**/dist +LICENSES +LICENSE +temp +**/README.md diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..8dc25d6 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,35 @@ +FROM rust:1 AS chef +RUN cargo install cargo-chef +WORKDIR /app + +FROM chef AS planner +COPY . . +RUN cargo chef prepare --recipe-path recipe.json + + +FROM chef AS builder +COPY --from=planner /app/recipe.json recipe.json +RUN cargo chef cook --release --recipe-path recipe.json +COPY . . + +# Install `dx` +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 dioxus-cli --root /.cargo -y --force +ENV PATH="/.cargo/bin:$PATH" + +# Create the final bundle folder. Bundle always executes in release mode with optimizations enabled +RUN dx bundle -p weaver-server + +FROM chef AS runtime + +COPY --from=builder /app/target/dx/weaver_server/release/web/ /usr/local/app + +# set our port and make sure to listen for all connections +ENV PORT=8080 +ENV IP=0.0.0.0 + +# expose the port 8080 +EXPOSE 8080 + +WORKDIR /usr/local/app +ENTRYPOINT [ "/usr/local/app/weaver-server" ] -- knotmirror 0.0.1