Boa Noite, Ao fazer o curso de docker na aula 05, as imagens sobe as imagens porém não popula o banco.
1. http://localhost:8080/ --> Apresenta a tela sem o livros.
2. http://localhost:8080/seed --> Apresenta a mensagem "Livros salvos".
3. http://localhost:8080/ --> Continua apresentar a tela sem o livros.
Tentei outras soluções, mas acredito que o erro esteja na imagem do docker "douglasq/alura-book", pois os logs do container do docker "douglasq/alura-book" e o log apresentado segue abaixo:
"npm info it worked if it ends with ok
npm info using npm@5.3.0
npm info using node@v8.2.1
npm info lifecycle alura-docker@1.0.0prestart: alura-docker@1.0.0
npm info lifecycle alura-docker@1.0.0start: alura-docker@1.0.0
alura-docker@1.0.0 start /var/www node server.js
(node:21) DeprecationWarning: open()
is deprecated in mongoose >= 4.11.0, use openUri()
instead, or set the useMongoClient
option if using connect()
or createConnection()
. See http://mongoosejs.com/docs/connections.html#use-mongo-client
Server initialiazed on port 3000
Mongoose! Disconnected from mongodb://mongodb:27017/alura-books
Mongoose! Connection error: MongoError: failed to connect to server [mongodb:27017] on first connect [MongoError: getaddrinfo ENOTFOUND mongodb mongodb:27017] (node:21) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): MongoError: failed to connect to server [mongodb:27017] on first connect [MongoError: getaddrinfo ENOTFOUND mongodb mongodb:27017] (node:21) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code."