Saturday 10 June 2017

Node.js web application not running properly in Docker stack

I have a web application written in Node.js that I'm trying to get into Docker. Running the image with docker run -p 80:80 image works just fine; I'm able to access the webpage it's hosting. However, when I try to run it in a stack, I'm unable to access the page, and Chrome just sits "Waiting for localhost..." forever.

Dockerfile:

FROM readytalk/nodejs

WORKDIR /app
ADD . /app

RUN npm i

EXPOSE 80

CMD []
ENTRYPOINT ["/nodejs/bin/npm", "start"]

docker-compose.yml:

version: "3"
services:
  web:
    image: image_name
    deploy:
      replicas: 5
      resources:
        limits:
          cpus: "0.1"
          memory: 50M
      restart_policy:
        condition: on-failure
    ports:
      - "80:80"
    networks: 
      - webnet
networks:
  webnet:

Any help would be greatly appreciated.



via TheReturningVoid

No comments:

Post a Comment