Explore Courses Blog Tutorials Interview Questions
0 votes
in DevOps and Agile by (29.3k points)

I'm not sure I completely understand the role of Docker in the process of development and deployment.

Say, I create a Dockerfile with nginx, some database and something else which creates a container and runs fine.

I drop it somewhere in the cloud and execute it to install and configure all the dependencies and environment settings.

Next, I have a repository with a web application that I want to run inside the container I created and deployed in the first 2 steps. I regularly work on it and push the changes.

Now, how do I integrate the web application into the container?

Do I put it as a dependency inside the Dockerfile I create in the 1st step and recreate the container each time from scratch?

Or, do I deploy the container once but have procedures inside Dockerfile that install utils that pull the code from repo by command or via hooks?

What if a container is running but I want to change some settings of, say, nginx? Do I add these changes to Dockerfile and recreate the image?

In general, what's the role of Docker in the daily app development routine? Is it used often if the infrastructure is running fine and only code is changing?

1 Answer

0 votes
by (50.2k points)

I would separate the web app and the database into two containers. The web app would be a dependency of the container with nginx and rebuild that one every time you make changes to your code. You don't have to create the container from scratch.

But here for the general description about docker

Development with docker I would like to give you an outer view which helps you to understand how to develop apps in docker.


This documentation will give you a basic idea of how the docker development practice 

Here is the detail view of how we work on docker to deploy 


And this had a clear explanation of how we develop and deploy the docker and its workflow configuration.

For further more details on docker and devops tools here is a course that helps  trained by the professionals.

Browse Categories