-
Notifications
You must be signed in to change notification settings - Fork 5
/
Dockerfile
36 lines (24 loc) · 773 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
FROM node:22.8.0 AS builder
ARG COMMIT_HASH
ARG BUILD_NUMBER
ARG VERSION
WORKDIR /usr/app
COPY package.json package-lock.json tsconfig.json ./
COPY .ci .ci
RUN npm ci
COPY src src
RUN npm run build
RUN .ci/writeBuildInformation.sh
FROM node:22.8.0-alpine
RUN apk add --no-cache tini
RUN apk add libcap && setcap CAP_NET_BIND_SERVICE=+eip /usr/local/bin/node && apk del libcap
RUN mkdir -p /var/log/enmeshed-connector && chown -R node:node /var/log/enmeshed-connector
WORKDIR /usr/app
COPY config config
COPY package.json package-lock.json ./
RUN npm ci --omit=dev
COPY --from=builder /usr/app/dist/ dist/
LABEL org.opencontainers.image.source="https://github.com/nmshd/connector"
USER node
ENTRYPOINT ["/sbin/tini", "--"]
CMD ["node", "/usr/app/dist/index.js"]