Dockerizing our backend API

Running Elasticsearch on Docker was easy, because the image was already generated for us. However, Dockerizing the rest of the application requires slightly more effort.

We will start with Dockerizing the backend API, as this is a precondition for the frontend client.

Specifically, we'd need to do the following:

  1. Write a Dockerfile that sets up our environment so that we can run our API.
  2. Generate the image from our Dockerfile.
  3. Run our API inside a container based on the image, while ensuring that it can communicate with the Elasticsearch instance that is running inside another Docker container.

The next task is to write our Dockerfile, but before we dive straight in, let me give you an overview of the structure ...

Get Building Enterprise JavaScript Applications now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.