A python app needed to be Dockerized, and then it needs to be deployed on App Server 2
. We have already copied a requirements.txt
file (having the app dependencies) under /python_app/src/
directory on App Server 2
. Further complete this task as per details mentioned below:
- Create a
Dockerfile
under/python_app
directory:
- Use any
python
image as the base image. - Install the dependencies using
requirements.txt
file. - Expose the port
5001
. - Run the
server.py
script usingCMD
.
-
Build an image named
nautilus/python-app
using this Dockerfile. -
Once image is built, create a container named
pythonapp_nautilus
:
- Map port
5001
of the container to the host port8092
.
- Once deployed, you can test the app using
curl
command onApp Server 2
.