forked from device-management-toolkit/mps
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
33 lines (25 loc) · 794 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
#*********************************************************************
# Copyright (c) Intel Corporation 2021
# SPDX-License-Identifier: Apache-2.0
#*********************************************************************/
#Multistage docker layer to isolate the git credentials
#First stage copy and install dependencies
ARG BASE=node:16-bullseye-slim
FROM ${BASE} as builder
LABEL license='SPDX-License-Identifier: Apache-2.0' \
copyright='Copyright (c) Intel Corporation 2021'
WORKDIR /mps-microservice
EXPOSE 4433
EXPOSE 3000
COPY package*.json ./
# Install dependencies
RUN npm ci --unsafe-perm
COPY tsconfig.json ./
COPY src ./src/
COPY agent ./agent/
COPY .mpsrc ./
# Transpile TS -> JS
RUN npm run build
RUN npm prune --production
USER node
CMD [ "node", "./dist/index.js" ]