- sudo apt-get update (to check if all dependencies wrt apt are up to date)
- sudo apt install docker.io (to install docker)
- sudo snap install docker (to install all docker dependencies)
- docker --version (or docker -v) (to test if installation is done right)
- sudo docker run hello-world (This is a build=t- in docke image which is pulled to the local computer using this command)
- sudo docker images (Command to check number of images present on local)
- sudo docker ps -a (Displays all exited containers)
- sudo docker ps (To display the containers that are active)
- Make a file named "Dockerfile" (It is present in the repo)
- sudo docker build -t python-ext (Command to build a docker container , python-ext is the name of the image)
- docker run python-ext (to run the docker image)
- docker run -t -i python-ext (to run the docker image with interactive i/o where -t is the pseudo terminal and -i interactive mode)
- After masking the python scripts with FAST API routes, the main function is crucial where the port number and the host name are to be included.
- Next, build "Dockerfile" , where you can create your own working directory and copy the requirements,txt and the app.py into it (Refer to the Dockerfile within FASTapi folder)
- sudo docker build -t python-fastapi (python-fastapi is the name of the container)
- sudo docker run -p 8000:8000 python-fastapi (command to run the FASTAPI code and reach to the port from the container as intended)