Skip to content

Instantly share code, notes, and snippets.

@adnanrahic
Created June 1, 2020 11:59
Show Gist options
  • Save adnanrahic/f689fe31b917f1efdc64815f2b1062fb to your computer and use it in GitHub Desktop.
Save adnanrahic/f689fe31b917f1efdc64815f2b1062fb to your computer and use it in GitHub Desktop.
FROM alpine AS build
WORKDIR /usr/src/app
RUN apk add --no-cache --update \
python3 \
make \
gcc \
g++ \
nodejs \
nodejs-npm
COPY package.json package-lock.json ./
RUN npm install --production
#############
FROM alpine
WORKDIR /usr/src/app
RUN apk add --no-cache --update nodejs
COPY --from=build /usr/src/app/node\_modules ./node\_modules
COPY . .
EXPOSE 3000
CMD ["node", "server.js"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment