Nuxt.js: Not working with Docker

Created on 21 Feb 2017  路  7Comments  路  Source: nuxt/nuxt.js

I tried using the starter template with a docker container. I know the docker config is ok, left the port at 3000 and also tried 80 but no luck in browser. Console has no info.

Any ideas?

This question is available on Nuxt.js community (#c246)

Most helpful comment

@bryaan Can you share the Dockerfile of the nuxt project?

All 7 comments

      HOST: '0.0.0.0'
      PORT: 80

That was easy, hope it helps

Hey @bryaan, you can help-me?

@bryaan Can you share the Dockerfile of the nuxt project?

@RobvanGastel

FROM node:7.8

ADD . /app
WORKDIR /app

RUN npm install

ARG APP_NODE_ENV=production
ENV NODE_ENV ${NODE_ENV}
RUN npm run build

EXPOSE 3000

CMD ["npm", "run", "start"]

Important is to configure 0.0.0.0 as host. See https://nuxtjs.org/faq/host-port/

This is great! If you are using docker-compose you can define the HOST using environment variables as specified in @tillkolter link above.

web:
  environment:
    - HOST=0.0.0.0

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

bimohxh picture bimohxh  路  3Comments

bimohxh picture bimohxh  路  3Comments

jaredreich picture jaredreich  路  3Comments

danieloprado picture danieloprado  路  3Comments

pehbehbeh picture pehbehbeh  路  3Comments