forked from streamr-dev/network
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.broker
31 lines (25 loc) · 950 Bytes
/
Dockerfile.broker
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:18-bullseye as build
WORKDIR /usr/src/network
COPY . .
RUN --mount=type=cache,target=/root/.npm \
npm run bootstrap-pkg --package=streamr-client && \
npm run bootstrap-pkg --package=streamr-broker && \
npm run prune-pkg -- streamr-broker
FROM node:18-bullseye-slim
ARG NODE_ENV
ENV NODE_ENV=${NODE_ENV:-production}
RUN apt-get update && apt-get --assume-yes --no-install-recommends install \
curl \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
RUN usermod -d /home/streamr -l streamr node && groupmod -n streamr node
USER streamr
WORKDIR /home/streamr/network
COPY --chown=root:root --from=build /usr/src/network/ .
ENV LOG_LEVEL=info
EXPOSE 1883/tcp
EXPOSE 7170/tcp
EXPOSE 7171/tcp
WORKDIR /home/streamr/network/packages/broker
# start broker from default config (needs mounted volume, e.g. docker run -v $(cd ~/.streamr/config;pwd):/home/streamr/.streamr/config IMAGE
CMD ["/usr/local/bin/npm", "exec", "streamr-broker"]