-
Notifications
You must be signed in to change notification settings - Fork 50
/
Dockerfile.node
63 lines (51 loc) · 2.38 KB
/
Dockerfile.node
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#
# Dockerfile for nucliadb's index node, compiling the node in the docker build.
# For a version that uses pre-built binaries (outside Docker) see `Dockerfile.node_prebuild`
#
FROM rust:1.76.0-bullseye AS builder
# Install system dependencies
COPY scripts/install-system-deps.sh /tmp/
RUN /tmp/install-system-deps.sh && rm /tmp/install-system-deps.sh && rm -rf /var/lib/apt/lists/*
COPY Cargo.toml Cargo.lock rust-toolchain.toml /nucliadb/
COPY .cargo/config.toml /nucliadb/.cargo/
COPY nucliadb_core /nucliadb/nucliadb_core
COPY nucliadb_node /nucliadb/nucliadb_node
COPY nucliadb_node_binding /nucliadb/nucliadb_node_binding
COPY nucliadb_paragraphs3 /nucliadb/nucliadb_paragraphs3
COPY nucliadb_procs /nucliadb/nucliadb_procs
COPY nucliadb_protos /nucliadb/nucliadb_protos
COPY nucliadb_relations2 /nucliadb/nucliadb_relations2
COPY nucliadb_texts3 /nucliadb/nucliadb_texts3
COPY nucliadb_vectors /nucliadb/nucliadb_vectors
COPY vectors_benchmark /nucliadb/vectors_benchmark
RUN mkdir -p /nucliadb/tmp
ENV TMPDIR=/nucliadb/tmp
WORKDIR /nucliadb
# Build dependencies (this is the cached docker layer)
RUN cargo build --locked --release --bin node_reader --bin node_writer
FROM debian:bullseye-slim AS nucliadb
ENV DATA_PATH=data
ENV RUST_LOG=nucliadb_node=DEBUG
ENV RUST_BACKTRACE=1
RUN apt-get -y update \
&& apt-get -y install ca-certificates curl \
libssl1.1 \
lmdb-utils \
libdw-dev \
linux-perf \
linux-base \
&& cp /usr/bin/perf_5.10 /usr/bin/perf_5.15 \
&& rm -rf /var/lib/apt/lists/*
RUN set -eux; \
dpkgArch="$(dpkg --print-architecture)"; \
case "${dpkgArch##*-}" in \
amd64) probeArch='amd64'; probeSha256='8d104fb997c9a5146a15a9c9f1fd45afa9d2dd995e185aeb96a19263fbd55b8a' ;; \
arm64) probeArch='arm64'; probeSha256='6a74ac6eebb173987dd4a68fa99b74b2e1bdd3e0c7cf634c0d823595fbb28609' ;; \
i386) probeArch='386'; probeSha256='eaed3339e273116d2c44a271d7245da1999b28a0c0bdf1d7b3aa75917712dc1a' ;; \
*) echo >&2 "unsupported architecture: ${dpkgArch}"; exit 1 ;; \
esac; \
curl -L -o /bin/grpc_health_probe https://github.com/grpc-ecosystem/grpc-health-probe/releases/download/v0.4.17/grpc_health_probe-linux-${probeArch}; \
echo "${probeSha256} /bin/grpc_health_probe" | sha256sum -c -; \
chmod +x /bin/grpc_health_probe
COPY --from=builder /nucliadb/target/release/node_reader /nucliadb/target/release/node_writer /usr/local/bin
EXPOSE 4444/udp