14 lines
621 B
Docker
14 lines
621 B
Docker
FROM rust:1.88-bookworm AS builder
|
|
WORKDIR /build
|
|
RUN apt-get update && apt-get install -y --no-install-recommends pkg-config libssl-dev ca-certificates && rm -rf /var/lib/apt/lists/*
|
|
COPY . .
|
|
RUN cargo generate-lockfile && cargo build --release --locked
|
|
|
|
FROM debian:bookworm-slim
|
|
RUN apt-get update && apt-get install -y --no-install-recommends ca-certificates libssl3 && rm -rf /var/lib/apt/lists/*
|
|
RUN useradd --system --uid 10001 --create-home --home-dir /var/lib/rustbox rustbox
|
|
COPY --from=builder /build/target/release/rustbox /usr/local/bin/rustbox
|
|
USER rustbox
|
|
EXPOSE 3001
|
|
ENTRYPOINT ["/usr/local/bin/rustbox"]
|