Le Koj Group LLC

Blog Post

white shape
blue shape
white shape

Open Existing Python App In A Docker Container

python code min scaled

The following steps will show you how to easily open an existing python app inside docker.

4 SIMPLE COMMAND TO OPEN AN EXISTING PYTHON APP IN A DOCKER CONTAINER

In terminal, change directory [ cd ] into the root folder of the python application. Run the following command to start a docker container for the app.

docker container run -it --name=[CONTAINER_NAME] -v $(pwd):/home [PYTHON-IMAGE] bash

In the bash shell of the project’s docker container, run the following command to change the present working directory to the home directory

cd  home

In home directory, run the following command to see your app’s files/folders in the home directory.

ls

Note:

The flag [ -v $(pwd):/home ] mounts the container’s  [home ] directory to the app’s root folder