-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
33 lines (24 loc) · 857 Bytes
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
FROM --platform=linux/amd64 rust:1.74-slim-bookworm as builder
RUN rustup default nightly
RUN rustup target add wasm32-unknown-unknown
RUN apt-get update && apt-get install -y \
libssl-dev \
pkg-config \
&& rm -rf /var/lib/apt/lists/*
RUN cargo install cargo-leptos
WORKDIR /app
COPY . .
RUN cargo leptos build --release
FROM --platform=linux/amd64 debian:bookworm-slim
# Copy the server binary to the /app directory
COPY --from=builder /app/target/release/leptos-actix-webtransport-template /app/
# /target/site contains our JS/WASM/CSS, etc.
COPY --from=builder /app/target/site /app/site
# Copy Cargo.toml if it’s needed at runtime
COPY --from=builder /app/Cargo.toml /app/
WORKDIR /app
ENV RUST_LOG="info"
ENV LEPTOS_SITE_ADDR="0.0.0.0:8080"
ENV LEPTOS_SITE_ROOT="site"
EXPOSE 8080
CMD ["/app/leptos-actix-webtransport-template"]