Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 20 additions & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
FROM alpine:3.14@sha256:eb3e4e175ba6d212ba1d6e04fc0782916c08e1c9d7b45892e9796141b1d379ae
# Stage 1: Build
FROM alpine:3.14@sha256:eb3e4e175ba6d212ba1d6e04fc0782916c08e1c9d7b45892e9796141b1d379ae AS build

ENV BLUEBIRD_WARNINGS=0 \
NODE_ENV=production \
Expand All @@ -7,15 +8,27 @@ ENV BLUEBIRD_WARNINGS=0 \
SUPPRESS_NO_CONFIG_WARNING=true

RUN apk add --no-cache \
nodejs
nodejs \
npm

COPY package.json ./

RUN apk add --no-cache npm \
&& npm i --no-optional \
&& npm cache clean --force \
&& apk del npm

RUN npm i --no-optional \
&& npm cache clean --force

# Stage 2: Runtime
FROM alpine:3.14@sha256:eb3e4e175ba6d212ba1d6e04fc0782916c08e1c9d7b45892e9796141b1d379ae

ENV BLUEBIRD_WARNINGS=0 \
NODE_ENV=production \
NODE_NO_WARNINGS=1 \
NPM_CONFIG_LOGLEVEL=warn \
SUPPRESS_NO_CONFIG_WARNING=true

RUN apk add --no-cache \
nodejs

COPY --from=build /node_modules /node_modules
COPY . /app

CMD ["node","/app/app.js"]
Expand Down