Files
cnats/Dockerfile
T

26 lines
734 B
Docker
Raw Normal View History

# Multi-stage build for the cnats Leptos (SSR + hydrate) app.
# Built by the infrastructure repo via `docker_image.cnats` (or manually:
# docker build -t cnats .)
FROM rust:1-bookworm AS builder
RUN rustup target add wasm32-unknown-unknown \
&& cargo install cargo-leptos --locked
WORKDIR /app
COPY . .
RUN cargo leptos build --release
FROM debian:bookworm-slim
RUN apt-get update \
&& apt-get install -y --no-install-recommends ca-certificates \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /app
COPY --from=builder /app/target/release/cnats /usr/local/bin/cnats
COPY --from=builder /app/target/site /app/site
ENV LEPTOS_SITE_ROOT=/app/site \
LEPTOS_SITE_ADDR=0.0.0.0:3000 \
RUST_LOG=info
EXPOSE 3000
CMD ["cnats"]