Posts

Showing posts with the label Python on Docker

Python Web Framework Flask App on Docker Container

Image
 Namaste this post is an extension of the Docker image management. In this post, I would like to talk about how the Dockerfile content will work to build the Python web framework using the Flask app. Let's consider a web platform we have multiple choices to use as a web application to run on docker container: Python web app using Flask Node.JS app Web app run with Go For all these program execution structures is similar you must have 'app' folder. Where you can write your web application code. FROM python:3.9.4-alpine COPY requirements.txt / RUN pip3 install -r /requirements.txt COPY . /app WORKDIR /app ENTRYPOINT ["./gunicorn.sh"] Here the base image used as Python3 version with apline which is thinner image. As pip installer will use requirement.txt file to install the dependencies libraries and packages required for running Flask. COPY instruciton used to copy the files from docker host machine to container image. WORKDIR is like cd command. ENTRYPOI...