forked from nuclia/nucliadb
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDockerfile.node_sidecar
49 lines (40 loc) · 2.1 KB
/
Dockerfile.node_sidecar
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
FROM python:3.9 AS builder
RUN mkdir -p /usr/src/app
RUN pip install Cython==0.29.24 pybind11
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 requirements from all packages to install them before
# transfering the source code.
COPY VERSION /usr/src/app/VERSION
COPY nucliadb_utils/requirements.txt /usr/src/app/requirements-utils.txt
COPY nucliadb_utils/requirements-storages.txt /usr/src/app/requirements-storages.txt
COPY nucliadb_protos/python/requirements.txt /usr/src/app/requirements-protos.txt
COPY nucliadb_node/requirements.txt /usr/src/app/requirements-node.txt
COPY nucliadb_telemetry/requirements.txt /usr/src/app/requirements-telemetry.txt
RUN set -eux; \
pip install --no-cache-dir \
-r /usr/src/app/requirements-utils.txt \
-r /usr/src/app/requirements-storages.txt \
-r /usr/src/app/requirements-telemetry.txt \
-r /usr/src/app/requirements-protos.txt \
-r /usr/src/app/requirements-node.txt
# Copy source code
COPY nucliadb_utils /usr/src/app/nucliadb_utils
COPY nucliadb_telemetry /usr/src/app/nucliadb_telemetry
COPY nucliadb_protos /usr/src/app/nucliadb_protos
COPY nucliadb_node /usr/src/app/nucliadb_node
WORKDIR /usr/src/app
# Install all dependendencies on packages on the nucliadb repo
# and finally the main component.
RUN pip install -r nucliadb_node/requirements-sources.txt
RUN pip install --no-deps -e /usr/src/app/nucliadb_node
WORKDIR /usr/src/app