Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding step to build the app with docker in existing projects #34083

Merged
merged 5 commits into from Feb 11, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
15 changes: 15 additions & 0 deletions examples/with-docker/README.md
Expand Up @@ -20,6 +20,21 @@ yarn create next-app --example with-docker nextjs-docker

You can view your images created with `docker images`.

### In existing projects

To add support for docker to an existing project, just copy the `Dockerfile` into the root of the project and add the following to the `next.config.js` file:
sespinosa marked this conversation as resolved.
Show resolved Hide resolved
```js
// next.config.js
module.exports = {
// ... rest of the configuration.
experimental: {
outputStandalone: true,
}
}

```
This will build the project as a standalone app inside the Docker image.

## Deploying to Google Cloud Run

1. Install the [Google Cloud SDK](https://cloud.google.com/sdk/docs/install) so you can use `gcloud` on the command line.
Expand Down