-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathDockerfile
More file actions
32 lines (21 loc) · 768 Bytes
/
Dockerfile
File metadata and controls
32 lines (21 loc) · 768 Bytes
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
FROM node:20 AS build
WORKDIR /code
COPY ./package.json ./package-lock.json /code/
RUN npm ci
COPY . /code
RUN npm run build
# -----------------------------------------------------
FROM node:20-alpine AS runtime
WORKDIR /code
COPY --from=build /code/package.json /code/package.json
COPY --from=build /code/package-lock.json /code/package-lock.json
RUN npm ci --omit=optional --omit=dev && npm cache clean --force
RUN npm audit --omit=optional --omit=dev
COPY --from=build /code/build /code/build
COPY --from=build /code/openapi-nodegen-api-file.yml /code/openapi-nodegen-api-file.yml
COPY ./docker-entrypoint.sh /sbin/
RUN chmod 755 /sbin/docker-entrypoint.sh
RUN chown -R node:node /code/
USER node
ENTRYPOINT [ "/sbin/docker-entrypoint.sh" ]
CMD ["prod"]