O'Reilly logo

Hands-On Microservices with Node.js by Diogo Resende

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Running our service

The only part missing is our main service. We need to rebuild it again. If you change the source code to use RethinkDB again, you have to change the package.json  file in order to have different dependencies. We need to rebuild this using our Dockerfile. To avoid introducing another theme, which is Docker Volumes, let's change our RethinkDB connection to not depend on the settings file:

rethinkdb.connect({ host: "database", db: "imagini" }, (err, db) => {

This way, we can avoid mounting a settings file altogether. Now, let's just increment the version and build it on both tabs:

docker build -t imagini:0.0.6 .

Now, the only thing missing is creating our service:

docker service create --name imagini --network imagini --publish ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required