Skip to content

Instantly share code, notes, and snippets.

@mixth
Created December 29, 2017 09:13
Show Gist options
  • Select an option

  • Save mixth/f4b8aa74461a21e6839e0b4d26278645 to your computer and use it in GitHub Desktop.

Select an option

Save mixth/f4b8aa74461a21e6839e0b4d26278645 to your computer and use it in GitHub Desktop.
# Using node as intermediate to build
FROM node:8.9.3 as build-image
LABEL maintainer Narat S <narat.s@hbot.io>
WORKDIR /home/node/app
COPY . ./
RUN npm install
RUN npm run build
# Using nginx as a final image to run app
FROM nginx:1.13.7-alpine
WORKDIR /usr/share/nginx/html
COPY --from=build-image /home/node/app/public .
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment