Running Express Mongo app in Rancher via docker-compose file -
i have setup rancher cluster 2 hosts, 1 running on aws , running on do. want have this application running on it. simple todo application listing port 4000. running fine on local docker environment, doing 'docker-compose up'. however, running on rancher cluster not working.
i thought easy choose 'add stack' in rancher , provide below docker-compose.yml file
mongo-container: image: mongo web: image: wiwa1978/express-mongo-todo ports: - "4000:4000" links: - mongo-container
however, express container swapping between 'active' , 'unhealthy'. looking in log files see following:
error: failed connect [localhost:27017]
however, there mongo container running per docker-compose.yml file. mongo container active in rancher. in application code i'm reading database setting config file:
module.exports = { url : 'mongodb://mongo-container:27017/todo' }
any idea if possible @ run via 'add stack' in rancher?
Comments
Post a Comment