Skip to content

Commit

Permalink
Dockerfile in multi-stage build. Image only depends on nginx serving …
Browse files Browse the repository at this point in the history
…static files.
  • Loading branch information
samalba committed Nov 7, 2018
1 parent d921b72 commit 3b44b05
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM node:latest
FROM node:latest as build-env

# Create app directory
RUN mkdir -p /usr/src/app
@@ -14,5 +14,7 @@ COPY . /usr/src/app

RUN yarn build

EXPOSE 8080
CMD [ "yarn", "start" ]
FROM nginx

COPY nginx.conf /etc/nginx/conf.d/default.conf
COPY --from=build-env /usr/src/app/dist /usr/share/nginx/html

0 comments on commit 3b44b05

Please sign in to comment.