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

Remove unused "start" script from with-docker/package.json #31053

Merged
merged 2 commits into from Feb 5, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
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
2 changes: 0 additions & 2 deletions examples/with-docker/README.md
Expand Up @@ -22,8 +22,6 @@ You can view your images created with `docker images`.

## Deploying to Google Cloud Run

The `start` script in `package.json` has been modified to accept a `PORT` environment variable (for compatibility with Google Cloud Run).

Comment on lines -25 to -26
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe it is not necessary to change the usage of next start since it will pick up $PORT value anyway (the -p flag is redundant if $PORT variable is present)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is explicitly needed for deployment to Google Cloud. Maybe we can add a comment?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So I understand correctly - which part is needed for GC, the start script in package.json, or the -p parameter on next CLI, or both?

We don't pass the -p parameter in Dockerfile CMD since 5abfea3.

Happy to close this PR if not needed!

1. Install the [Google Cloud SDK](https://cloud.google.com/sdk/docs/install) so you can use `gcloud` on the command line.
1. Run `gcloud auth login` to log in to your account.
1. [Create a new project](https://cloud.google.com/run/docs/quickstarts/build-and-deploy) in Google Cloud Run (e.g. `nextjs-docker`). Ensure billing is turned on.
Expand Down
3 changes: 1 addition & 2 deletions examples/with-docker/package.json
Expand Up @@ -2,8 +2,7 @@
"private": true,
"scripts": {
"dev": "next dev",
"build": "next build",
"start": "next start -p ${PORT:=3000}"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed unused script for clarity - the Dockerfile contains the entrypoint in this example

"build": "next build"
},
"dependencies": {
"next": "latest",
Expand Down