Skip to content

Commit

Permalink
fix: expose only 3000 and 4433, and update docker file
Browse files Browse the repository at this point in the history
  • Loading branch information
graikhel-intel committed Feb 2, 2024
1 parent 39f7544 commit df43da9
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,9 @@
#Multistage docker layer to isolate the git credentials
#First stage copy and install dependencies
FROM node:20-bullseye-slim@sha256:9cb48d12eeccb9e6ad25e987dda1077399cd63877a46e9e848273c44690ca175 as builder
LABEL license='SPDX-License-Identifier: Apache-2.0' \
copyright='Copyright (c) Intel Corporation 2021'

WORKDIR /mps

EXPOSE 4433
EXPOSE 3000

COPY package*.json ./

# Install dependencies
Expand All @@ -28,21 +23,21 @@ RUN npm run build
RUN npm prune --production

FROM alpine:latest@sha256:c5b1261d6d3e43071626931fc004f70149baeba2c8ec672bd4f27761f8e1ad6b
LABEL license='SPDX-License-Identifier: Apache-2.0' \
copyright='Copyright (c) Intel Corporation 2021'

RUN addgroup -g 1000 node && adduser -u 1000 -G node -s /bin/sh -D node
RUN apk update && apk upgrade --no-cache && apk add nodejs --no-cache

COPY --from=builder /mps/dist /mps/dist
# for healthcheck backwards compatibility
COPY --from=builder /mps/dist/Healthcheck.js /dist/Healthcheck.js
COPY --from=builder /mps/.mpsrc /.mpsrc
COPY --from=builder /mps/node_modules /mps/node_modules
COPY --from=builder /mps/package.json /mps/package.json
# set the user to non-root
USER node
# Default Ports Used
EXPOSE 8080
EXPOSE 8081
EXPOSE 8082
EXPOSE 4433
EXPOSE 3000

CMD ["node", "/mps/dist/index.js"]

0 comments on commit df43da9

Please sign in to comment.