-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile
More file actions
18 lines (17 loc) · 907 Bytes
/
Dockerfile
File metadata and controls
18 lines (17 loc) · 907 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
FROM rust:1.93.1-bookworm AS builder
WORKDIR /workspace
RUN apt-get update && apt-get install -y --no-install-recommends pkg-config libsqlite3-dev ca-certificates && rm -rf /var/lib/apt/lists/*
COPY Cargo.toml Cargo.lock ./
COPY crates ./crates
RUN cargo build --release -p pqmsg-server
FROM debian:bookworm-slim AS runtime
WORKDIR /app
RUN apt-get update && apt-get install -y --no-install-recommends ca-certificates libsqlite3-0 tini curl && rm -rf /var/lib/apt/lists/* && useradd --system --uid 10001 --create-home --home-dir /app pqmsg
COPY --from=builder /workspace/target/release/pqmsg-server /usr/local/bin/pqmsg-server
USER 10001:10001
ENV PQMSG_BIND=0.0.0.0:8080
ENV RUST_LOG=pqmsg_server=info
EXPOSE 8080
HEALTHCHECK --interval=30s --timeout=5s --start-period=10s --retries=3 \
CMD curl -sf http://localhost:8080/health || exit 1
ENTRYPOINT ["/usr/bin/tini","--","/usr/local/bin/pqmsg-server"]