How to Dockerize a Python Flask App and Deploy It on a Linux Server
A Python Flask application was containerized using Docker as part of a hands-on DevOps exercise on App Server 1 (stapp01). A Dockerfile was created under the /python_app directory, using a Python 3.9-slim base image, installing dependencies from requirements.txt, and exposing port 6100. The Flask app, defined in server.py, returns a welcome message when the root URL is accessed and runs on all network interfaces at port 6100. A Docker image named nautilus/python-app was built from the Dockerfile, and a container named pythonapp_nautilus was launched with host port 8099 mapped to container port 6100. The deployment was verified by running a curl command against http://localhost:8099/, confirming the application responded successfully.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.

Discussion (0)
Log in to join the discussion and vote.
Log in