Skip to content

Commit

Permalink
Edited Dockerfile of Docker(Nginx) deployment doc (#4561)
Browse files Browse the repository at this point in the history
* Edited Dockerfile of Docker(Nginx) deployment doc

Edited `Dockerfile` section of https://cli.vuejs.org/guide/deployment.html#docker-nginx

As shown in [Vue v2 cookbook](https://vuejs.org/v2/cookbook/dockerize-vuejs-app.html) copying `package*.json` initially and running `npm install` in a separate step allows caching and reduces time elapsed during Docker build. Also the difference between the two docs will be reduced and be less confusing to those who end up with both of them.

* node version to latest
  • Loading branch information
vahdet authored and NataliaTepluhina committed Sep 21, 2019
1 parent 9c99ce2 commit 69f7145
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions docs/guide/deployment.md
Expand Up @@ -395,14 +395,16 @@ Deploy your application using nginx inside of a docker container.
2. Create a `Dockerfile` file in the root of your project.

```Dockerfile
FROM node:10
COPY ./ /app
FROM node:latest as build-stage
WORKDIR /app
RUN npm install && npm run build
COPY package*.json ./
RUN npm install
COPY ./ .
RUN npm run build

FROM nginx
FROM nginx as production-stage
RUN mkdir /app
COPY --from=0 /app/dist /app
COPY --from=build-stage /app/dist /app
COPY nginx.conf /etc/nginx/nginx.conf
```

Expand Down

0 comments on commit 69f7145

Please sign in to comment.