forked from eclipse-thingweb/node-wot
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
38 lines (28 loc) · 827 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
31
32
33
34
35
36
37
38
FROM docker.io/library/node:18-alpine as BUILD
RUN apk add --no-cache \
gcc \
g++ \
make \
linux-headers \
udev \
python3
## change it to maintain all the dev dependencies
ARG BUILD_ENV=production
WORKDIR /app
COPY ./package.json ./
COPY ./package-lock.json ./
COPY ./tsconfig.json ./
COPY ./packages packages/
RUN npm install && npm run build
# now remove dev dependencies by reinstalling for production
# this wil reduce the size of the image built in next steps significantly
RUN if [ "${BUILD_ENV}" = "production" ]; then npm prune --production; fi
FROM docker.io/library/node:18-alpine
COPY --from=BUILD /app /app
WORKDIR /app/packages/cli
EXPOSE 8080/tcp
EXPOSE 5683/udp
STOPSIGNAL SIGINT
ENTRYPOINT [ "node", "dist/cli.js" ]
CMD [ "-h" ]
## docker build -t wot-servient ./docker/Dockerfile