diff --git a/application/Cargo.toml b/application/Cargo.toml index 3f4f1f5..629a699 100644 --- a/application/Cargo.toml +++ b/application/Cargo.toml @@ -77,7 +77,7 @@ style-file = "style/main.scss" assets-dir = "public" # The IP and port (ex: 127.0.0.1:3000) where the server serves the content. Use it in your server setup. -site-addr = "127.0.0.1:3000" +site-addr = "0.0.0.0:3000" # The port to use for automatic reload monitoring reload-port = 3001 diff --git a/application/Dockerfile b/application/Dockerfile new file mode 100644 index 0000000..5a6644f --- /dev/null +++ b/application/Dockerfile @@ -0,0 +1,31 @@ +# Get started with a build env with Rust nightly +FROM rustlang/rust:nightly-alpine as builder + +RUN apk update && \ + apk add --no-cache bash curl npm libc-dev binaryen + +RUN npm install -g sass + +RUN curl --proto '=https' --tlsv1.2 -LsSf https://github.com/leptos-rs/cargo-leptos/releases/latest/download/cargo-leptos-installer.sh | sh + +# Add the WASM target +RUN rustup target add wasm32-unknown-unknown + +WORKDIR /work +COPY . . + +RUN cargo leptos build --release -vv + +FROM rustlang/rust:nightly-alpine as runner + +WORKDIR /app + +COPY --from=builder /work/target/release/leptos_start /app/ +COPY --from=builder /work/target/site /app/site +COPY --from=builder /work/Cargo.toml /app/ + +EXPOSE $PORT +ENV LEPTOS_SITE_ROOT=./site + +CMD ["/app/leptos_start"] + diff --git a/application/src/util/websocket/client.rs b/application/src/util/websocket/client.rs index 0f54b29..1e72302 100644 --- a/application/src/util/websocket/client.rs +++ b/application/src/util/websocket/client.rs @@ -9,7 +9,7 @@ pub fn init_websocket() { ready_state, message, .. - } = use_websocket("ws://localhost:3000/ws"); + } = use_websocket("ws://192.168.100.122:3000/ws"); provide_context(ready_state);