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

Creating images

Before we deploy, we need to create an image for our service to run inside. Our service has no dependencies other than the ones defined on the top:

  • express and body-parser: To handle our HTTP requests
  • mysql: It enables us to use a MySQL database
  • sharp: It enables us to manipulate images
  • path: It is a core module to help working with directory paths

The core module is not a problem, and the first three are also not a problem since they're built completely in JavaScript. On the other hand, sharp is compiled, so our image needs to have at least a compiler.

To keep our image as slim as possible, we'll be using the Node.js Alpine version, which is a Node.js image based on Alpine Linux and it has a much smaller size than other ...

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