-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdockerfile
27 lines (24 loc) · 868 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
ARG NODE_VERSION=22
ARG ALPINE_VERSION=
ARG USER=node
ARG GROUP=${USER}
FROM node:${NODE_VERSION}-alpine${ALPINE_VERSION} AS base
FROM base AS build
WORKDIR /build
COPY . .
RUN npm ci --build-from-resource \
&& npm run build
FROM base AS app
ARG USER
ARG GROUP
WORKDIR /app
COPY --chown=${USER}:${GROUP} --from=build /build/dist ./dist
COPY --chown=${USER}:${GROUP} --from=build /build/node_modules ./node_modules
COPY --chown=${USER}:${GROUP} --from=build /build/package.json ./package.json
COPY --chown=${USER}:${GROUP} --from=build /build/npm-shrinkwrap.json ./npm-shrinkwrap.json
COPY --chown=${USER}:${GROUP} --from=build /build/fonts ./fonts
COPY --chown=${USER}:${GROUP} --from=build /build/placeholder.config.json ./placeholder.config.json
USER ${USER}
RUN npm prune --omit=dev
EXPOSE 3000
CMD ["node", "dist/index.js", "-c", "placeholder.config.json"]