Unverified Commit 0084166c authored by Eldar Amantay's avatar Eldar Amantay Committed by GitHub

chore(docs): Add mentioning of HOSTNAME env variable for standalone output (#52804)

### What?

Update documentation to mention a `HOSTNAME` env variable for `standalone` output

Related to Feature: https://github.com/vercel/next.js/pull/44627 

### Why?

Current documentation mentions only `PORT` env, but does not mention `HOSTNAME` added in January

Affected documentation pages:

- https://nextjs.org/docs/app/api-reference/next-config-js/output

Affected examples:

- https://github.com/vercel/next.js/tree/canary/examples/with-docker
- https://github.com/vercel/next.js/tree/canary/examples/with-docker-multi-env

### How?

- Run examples
- Check documentation
parent 98a8b1cc
...@@ -41,6 +41,7 @@ Additionally, a minimal `server.js` file is also output which can be used instea ...@@ -41,6 +41,7 @@ Additionally, a minimal `server.js` file is also output which can be used instea
> >
> - `next.config.js` is read during `next build` and serialized into the `server.js` output file. If the legacy [`serverRuntimeConfig` or `publicRuntimeConfig` options](/docs/app/api-reference/next-config-js/runtime-configuration) are being used, the values will be specific to values at build time. > - `next.config.js` is read during `next build` and serialized into the `server.js` output file. If the legacy [`serverRuntimeConfig` or `publicRuntimeConfig` options](/docs/app/api-reference/next-config-js/runtime-configuration) are being used, the values will be specific to values at build time.
> - If your project uses [Image Optimization](/docs/app/building-your-application/optimizing/images) with the default `loader`, you must install `sharp` as a dependency: > - If your project uses [Image Optimization](/docs/app/building-your-application/optimizing/images) with the default `loader`, you must install `sharp` as a dependency:
> - If your project needs alternative port or hostname for listening, you can define `PORT` and `HOSTNAME` environment variables, before running `server.js`. For example, `PORT=3000 HOSTNAME=localhost node server.js`.
</AppOnly> </AppOnly>
......
...@@ -47,5 +47,6 @@ USER nextjs ...@@ -47,5 +47,6 @@ USER nextjs
EXPOSE 3000 EXPOSE 3000
ENV PORT 3000 ENV PORT 3000
ENV HOSTNAME localhost
CMD ["node", "server.js"] CMD ["node", "server.js"]
...@@ -48,5 +48,6 @@ USER nextjs ...@@ -48,5 +48,6 @@ USER nextjs
EXPOSE 3000 EXPOSE 3000
ENV PORT 3000 ENV PORT 3000
ENV HOSTNAME localhost
CMD ["node", "server.js"] CMD ["node", "server.js"]
...@@ -48,5 +48,6 @@ USER nextjs ...@@ -48,5 +48,6 @@ USER nextjs
EXPOSE 3000 EXPOSE 3000
ENV PORT 3000 ENV PORT 3000
ENV HOSTNAME localhost
CMD ["node", "server.js"] CMD ["node", "server.js"]
...@@ -55,5 +55,6 @@ USER nextjs ...@@ -55,5 +55,6 @@ USER nextjs
EXPOSE 3000 EXPOSE 3000
ENV PORT 3000 ENV PORT 3000
ENV HOSTNAME localhost
CMD ["node", "server.js"] CMD ["node", "server.js"]
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment