-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDockerfile
25 lines (24 loc) · 1.02 KB
/
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
FROM myrotvorets/node:latest@sha256:ad42b0fe4125c22a2231242403a2801a9f7e3221dc63f70b6d1c75f57643da76 AS build
USER root
WORKDIR /srv/service
RUN chown nobody:nogroup /srv/service
USER nobody:nogroup
COPY --chown=nobody:nogroup ./package.json ./package-lock.json ./tsconfig.json .npmrc* ./
RUN \
npm ci --ignore-scripts --userconfig .npmrc.local && \
rm -f .npmrc.local && \
npm rebuild && \
npm run prepare --if-present
COPY --chown=nobody:nobody ./src ./src
RUN npm run build -- --declaration false --removeComments true --sourceMap false
RUN npm prune --omit=dev
FROM myrotvorets/node-min@sha256:0e5a703fa79c78c881c3a1014d7efd680e8abda280ec72c96c889bc1e8dd5797
USER root
WORKDIR /srv/service
RUN chown nobody:nobody /srv/service
USER nobody:nobody
ENTRYPOINT ["/usr/bin/node", "index.mjs"]
COPY --chown=nobody:nobody --from=build /srv/service/node_modules ./node_modules
COPY --chown=nobody:nobody ./src/specs ./specs
COPY --chown=nobody:nobody --from=build /srv/service/dist/ ./
COPY --chown=nobody:nobody ./package.json ./