Skip to content

Commit

Permalink
Merge branch 'canary' into hotfix/fix-css-paths
Browse files Browse the repository at this point in the history
  • Loading branch information
Timer authored Jan 3, 2020
2 parents 722028b + 2e3a972 commit 96df419
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 3 deletions.
4 changes: 3 additions & 1 deletion examples/with-docker/Dockerfile.multistage
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ RUN yarn build && yarn --production
# And then copy over node_modules, etc from that stage to the smaller base image
FROM mhart/alpine-node:base
WORKDIR /app
COPY --from=builder /app .
COPY --from=builder /app/node_modules ./node_modules
COPY --from=builder /app/.next ./.next
COPY --from=builder /app/next.config.js ./next.config.js
EXPOSE 3000
CMD ["node_modules/.bin/next", "start"]
10 changes: 9 additions & 1 deletion examples/with-docker/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,13 @@ docker build -t next-app .
docker build -t next-app -f ./Dockerfile.multistage .
```

Run it:
Alternatively you can add these commands as scripts to your package.json and simply run

`yarn build-docker`
or
`yarn build-docker-multistage`

Run the docker image:

```bash
docker run --rm -it \
Expand All @@ -39,6 +45,8 @@ docker run --rm -it \
next-app
```

or use `yarn build-docker-multistage`

Deploy it to the cloud with [now](https://zeit.co/now) ([download](https://zeit.co/download))

```bash
Expand Down
5 changes: 4 additions & 1 deletion examples/with-docker/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@
"scripts": {
"dev": "next",
"build": "next build",
"start": "next start"
"start": "next start",
"build-docker": "docker build -t next-app .",
"build-docker-multistage": "docker build -t next-app -f ./Dockerfile.multistage .",
"run-docker": "docker run --rm -it -p 3000:3000 -e 'API_URL=https://example.com' next-app"
},
"dependencies": {
"next": "latest",
Expand Down

0 comments on commit 96df419

Please sign in to comment.