Nuxt.js: Docker compose can't bind the servers ip-address rather it's bind dockers inet address

Created on 11 May 2020  路  7Comments  路  Source: nuxt/nuxt.js

Version

v2.12.2

Reproduction link

https://codesandbox.com

Steps to reproduce

how can you reproduce this here? You need docker-compose to do that.

What is expected ?

It should run with machines inet address not dockers inet address. Hence I can't telnet it from another server.

What is actually happening?

Already described. Need to fix it asap.

This bug report is available on Nuxt community (#c10643)
bug-report pending-repro

All 7 comments

@Revel109 could you share your ./docker-compose.yml contents please?

@TimvdEijnden

```
version: "3"

services:
nuxt:
build: ./app/
container_name: my_nuxt_app
restart: always
ports:
- "3000:3000"
command:
"npm run start"
````

@Revel109 Could you please try by adding network_mode: "host" ?

@Revel109 If I understand your issue aright, you need to specify that Nuxt listens on the public interface (of the container), which can be done in the Nuxt config or via an environment variable:

    environment:
      HOST: 0.0.0.0

@Revel109 Working repro:

https://github.com/danielroe/docker-nuxt

@TimvdEijnden Yes, it's worked. Is it included in official docs?

"config": { "nuxt": { "host": "0.0.0.0", "port": "3000" } },
This config in package.json also worked.

Closing here as it's not a Nuxt issue.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

mikekidder picture mikekidder  路  3Comments

msudgh picture msudgh  路  3Comments

bimohxh picture bimohxh  路  3Comments

vadimsg picture vadimsg  路  3Comments

maicong picture maicong  路  3Comments