Skip to content

Commit

Permalink
fix(dockerfile): do not expose project root to production
Browse files Browse the repository at this point in the history
  • Loading branch information
Gerald Baulig committed Mar 12, 2024
1 parent 0987cd0 commit f23fe8f
Showing 1 changed file with 3 additions and 13 deletions.
16 changes: 3 additions & 13 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,9 @@ USER node
ARG APP_HOME=/home/node/srv
WORKDIR $APP_HOME

COPY package.json package.json
COPY package-lock.json package-lock.json

RUN npm ci

COPY --chown=node:node . .

RUN npm ci
RUN npm run build


Expand All @@ -25,15 +21,9 @@ USER node
ARG APP_HOME=/home/node/srv
WORKDIR $APP_HOME

COPY package.json package.json
COPY package-lock.json package-lock.json

COPY --chown=node:node . $APP_HOME
COPY --chown=node:node ./cfg $APP_HOME/cfg
COPY --chown=node:node --from=build $APP_HOME/lib $APP_HOME/lib

EXPOSE 50051

USER root
USER node

CMD [ "npm", "start" ]
CMD [ "node", "./lib/start.cjs" ]

0 comments on commit f23fe8f

Please sign in to comment.