Modify Dockerfile

This commit is contained in:
Nolan Poe 2022-12-11 04:35:23 +00:00
parent 1225502ca4
commit 118128f2e9

View file

@ -1,9 +1,19 @@
FROM node:current-slim
# build app
FROM docker.io/node:current-alpine3.15 AS builder
RUN apk update
RUN apk add git
COPY . /app
WORKDIR /app
COPY ./package.json ./package-lock.json ./src/ ./
RUN npm install
RUN npm install --omit=dev
# build final
FROM gcr.io/distroless/nodejs:16
ENTRYPOINT npm start
EXPOSE 8080/tcp
COPY --from=builder /app /
CMD ["src/index.js"]