-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
44 lines (30 loc) · 1.34 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
43
44
FROM node:12.16.1-alpine3.11 as BUILD
RUN apk add --no-cache \
gcc \
g++ \
make \
linux-headers \
udev \
python3
ARG BUILD_ENV=development
WORKDIR /home/node/app
COPY package*.json ./
RUN npm install
COPY . .
RUN npm run build \
&& if [ "${BUILD_ENV}" = "production" ]; then node_modules/.bin/lerna exec "npm prune --production"; fi
FROM node:12.16.1-alpine3.11
COPY --from=BUILD /home/node/app/packages/cli /usr/local/lib/node_modules/@node-wot/cli
COPY --from=BUILD /home/node/app/packages/td-tools /usr/local/lib/node_modules/@node-wot/td-tools
COPY --from=BUILD /home/node/app/packages/core /usr/local/lib/node_modules/@node-wot/core
COPY --from=BUILD /home/node/app/packages/binding-http /usr/local/lib/node_modules/@node-wot/binding-http
COPY --from=BUILD /home/node/app/packages/binding-file /usr/local/lib/node_modules/@node-wot/binding-file
COPY --from=BUILD /home/node/app/packages/binding-mqtt /usr/local/lib/node_modules/@node-wot/binding-mqtt
COPY --from=BUILD /home/node/app/packages/binding-coap /usr/local/lib/node_modules/@node-wot/binding-coap
COPY --from=BUILD /home/node/app/packages/binding-websockets /usr/local/lib/node_modules/@node-wot/binding-websockets
WORKDIR /usr/local/lib/node_modules/@node-wot/cli
EXPOSE 8080/tcp
EXPOSE 5683/udp
STOPSIGNAL SIGINT
ENTRYPOINT [ "node", "dist/cli.js" ]
CMD [ "-h" ]