Development using Docker

Development using Docker

Example: To run a web page application which stores data in mongo db.

Here UI backend uses javascript, node js.

Docker Networking

we can create isolate docker network to run multiple containers inside. Here inside same network, containers can interact using container names, without local port no etc

The application which is connecting docker network from outside needs to use port number and local host.

so our mongo db, mongo express, node js these are the seperate container images inside one docker network and browser running on host will connect to docker network using port and local host.

Working with databse images

to run container of db images, go on the docker image site, there mentioned start guide helps with initialising informations like environment variables to set username and pasword while creating db container from image.

Although docker image site has all the config listed to run databases, its tedious to write config lines each time we build a container, to resolve this manual entry of config writing of env variables, port, network, name. we use docker compose.