forked from streamr-dev/network
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
30 lines (25 loc) · 851 Bytes
/
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
FROM node:16-buster as build
WORKDIR /usr/src/monorepo
COPY . .
RUN npm set unsafe-perm true && \
# explicitly use npm v6
npm install -g npm@6 && \
npm ci && \
npm run bootstrap-pkg streamr-broker && \
# image contains all packages, remove devDeps to keep image size down
npx lerna exec -- npm prune --production && \
# restore inter-package symlinks removed by npm prune
npx lerna link
FROM node:16-buster-slim
RUN apt-get update && apt-get install --assume-yes --no-install-recommends curl \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
COPY --from=build /usr/src/monorepo /usr/src/monorepo
WORKDIR /usr/src/monorepo
ENV LOG_LEVEL=info
RUN ln -s packages/broker/tracker.js tracker.js
EXPOSE 1883/tcp
EXPOSE 7170/tcp
EXPOSE 7171/tcp
WORKDIR /usr/src/monorepo/packages/broker
CMD ./bin/broker.js # start broker from default config