21 lines
643 B
Docker
21 lines
643 B
Docker
FROM rust:1 AS builder
|
|
WORKDIR /usr/src/website
|
|
COPY . .
|
|
|
|
RUN rustup target add wasm32-unknown-unknown
|
|
RUN cargo install wasm-bindgen-cli
|
|
|
|
RUN ./build-wasm.sh
|
|
RUN cargo build --release -p server
|
|
|
|
FROM debian:trixie-slim
|
|
RUN apt-get update && apt-get install -y --no-install-recommends ca-certificates curl && rm -rf /var/lib/apt/lists/*
|
|
COPY --from=builder /usr/src/website/target/release/server /usr/local/bin/server
|
|
COPY --from=builder /usr/src/website/static /app/static
|
|
|
|
WORKDIR /app
|
|
EXPOSE 3000
|
|
HEALTHCHECK --interval=30s --timeout=5s --start-period=5s --retries=3 \
|
|
CMD curl -f http://localhost:3000/health || exit 1
|
|
|
|
CMD ["server"]
|