-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
42 lines (29 loc) · 1.13 KB
/
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
34
35
36
37
38
39
40
41
42
# syntax=docker/dockerfile:1
FROM --platform=$BUILDPLATFORM tonistiigi/xx:1.5.0 AS xx
FROM --platform=$BUILDPLATFORM rust:1.82.0-bookworm AS builder
COPY --from=xx / /
WORKDIR /usr/src/app
# hadolint ignore=DL3008
RUN apt-get update && apt-get install -y --no-install-recommends clang lld
COPY Cargo.lock Cargo.toml install-cross-deps.sh ./
COPY src ./src
RUN --mount=type=cache,target=/usr/local/cargo/git/db \
--mount=type=cache,target=/usr/local/cargo/registry/index \
--mount=type=cache,target=/usr/local/cargo/registry/cache \
cargo fetch
ARG TARGETPLATFORM
# hadolint ignore=SC1091
RUN --mount=type=cache,target=/usr/local/cargo/git/db \
--mount=type=cache,target=/usr/local/cargo/registry/index \
--mount=type=cache,target=/usr/local/cargo/registry/cache \
. ./install-cross-deps.sh && \
xx-cargo install --locked --path . --root . && \
xx-verify bin/*
# hadolint ignore=DL3006
FROM gcr.io/distroless/cc-debian12
WORKDIR /app
COPY --from=builder /usr/src/app/bin/* /usr/local/bin/
HEALTHCHECK CMD ["/usr/local/bin/healthcheck"]
USER nonroot
EXPOSE 8080
CMD ["/usr/local/bin/centrifugo-change-stream"]