Skip to content

Commit

Permalink
Add run on Google Cloud Run button to the docker example (#25824)
Browse files Browse the repository at this point in the history
## Documentation / Examples

- [x] Make sure the linting passes


### Deployed with Cloud Run Button

<img width="1075" alt="Screen Shot 2021-06-06 at 10 22 51 pm" src="https://user-images.githubusercontent.com/170554/120924210-d7946780-c715-11eb-889e-79679f795c54.png">

### Next.js working on Google Cloud Run

<img width="982" alt="Screen Shot 2021-06-06 at 10 23 10 pm" src="https://user-images.githubusercontent.com/170554/120924229-e418c000-c715-11eb-9aca-569923f7306d.png">
  • Loading branch information
geshan committed Jun 7, 2021
1 parent e1502bc commit b1b3b75
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 1 deletion.
4 changes: 4 additions & 0 deletions examples/with-docker/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,7 @@ yarn-error.log*

# vercel
.vercel

# lock files
yarn.lock
package-lock.json
4 changes: 4 additions & 0 deletions examples/with-docker/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@ The `start` script in `package.json` has been modified to accept a `PORT` enviro
- You will be prompted for [region](https://cloud.google.com/run/docs/quickstarts/build-and-deploy#follow-cloud-run): select the region of your choice, for example `us-central1`.
- You will be prompted to **allow unauthenticated invocations**: respond `y`.

Or click the button below, authorize the script, and select the project and region when prompted:

[![Run on Google Cloud](https://deploy.cloud.run/button.svg)](https://deploy.cloud.run/?git_repo=https://github.com/vercel/next.js.git&dir=examples/with-docker)

## Running Locally

First, run the development server:
Expand Down
10 changes: 10 additions & 0 deletions examples/with-docker/app.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"name": "nextjs",
"options": {
"allow-unauthenticated": true,
"memory": "256Mi",
"cpu": "1",
"port": 3000,
"http2": false
}
}
2 changes: 1 addition & 1 deletion examples/with-docker/pages/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export default function Home() {

<main className={styles.main}>
<h1 className={styles.title}>
Welcome to <a href="https://nextjs.org">Next.js!</a>
Welcome to <a href="https://nextjs.org">Next.js</a> on Docker!
</h1>

<p className={styles.description}>
Expand Down

0 comments on commit b1b3b75

Please sign in to comment.