Professional Documents
Culture Documents
Project : https://github.com/itsparser/code-tool
Following are the steps to create the docker image & run in a container
Structure/Files of the Project
The project mentioned in the previous slide contains the below listed files
• main.py -- Entry point for python application
• Dockerfile -- Docker file for building Ubuntu Image which contains the project code
• Dockerfile-runner -- Extending the ubuntu image generated in previous step & contains the
entrypoint for starting the project
• docker-compose.yml -- docker compose file which specifies the configuration for creating the
images using the above docker files
• requirements.txt -- requirements file contails the dependencies for project, used by the
Dockerfile while setting up the ubuntu environment
Building the Docker Image
• Execute the command “docker-compose build” to build the images
specified in the docker-compose.yml. [Note : If the file name is different
it needs to be externally specified like “****COMMAND HERE*****” ]
• Running the above command will first build the images which doesn't
have any dependency on other images being build parallely [here
testing/base] & then those images which depends on the previous
images will be build [here testing/service]
• The docker-compose.yml file contains the configuration with mapping
for the binding port in host machine with the ports in which the app
runs in the container
• So the command executed in the step 1 will build the image with
these configurations
• To start the application, execute the command “docker-compose up”
Thank You.