Skip to content

Instantly share code, notes, and snippets.

@tyhonchik
Created February 12, 2019 15:00
Show Gist options
  • Select an option

  • Save tyhonchik/2ef2f4ae9f941f5199b0203bfead925e to your computer and use it in GitHub Desktop.

Select an option

Save tyhonchik/2ef2f4ae9f941f5199b0203bfead925e to your computer and use it in GitHub Desktop.
Multi stage Dockerfile for RAZZLE app
# STEP 1:
# build with pkg
FROM node:latest AS build
WORKDIR /app
# install dependencies with cache
COPY package.json .
COPY yarn.lock .
RUN yarn
# copy app files, build and package
COPY . /app
RUN yarn package
# ----------------
# STEP 2:
# run with alpine
FROM alpine:latest
WORKDIR /app
ENV NODE_ENV=production
# install required libs
RUN apk update && apk add --no-cache libstdc++ libgcc
# copy prebuilt binary from previous step
COPY --from=build /app/app /app/app
CMD ["/app/app"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment