Coder Social home page Coder Social logo

docker-python's Introduction

This repository contains methods to Dockerize Python Projects.

Table of Contents


  • This example illustrates how to Dockerize a simple Python Project. [Source Code]
    • Download the HelloWorldPythonDocker project.
    • Navigate inside the HelloWorldPythonDocker project folder from Docker QuickStart Terminal.
    • Execute the below commands- image image
    • Check Docker Hub: [Docker Hub URL] image

  • This example illustrates how to Dockerize a Flask WebService Project. [Source Code]
    • Download the FlaskWebServiceDocker project.

    • Navigate inside the FlaskWebServiceDocker project folder from Docker QuickStart Terminal.

    • Execute the below commands-
      image image
      Before executing the below commands, I preffered to clean the docker history. Followed the below commands:

      • docker rm -vf $(docker ps -a -q)
      • docker rmi -f $(docker images -a -q)

      image Here we have used -p which specifies the port it is going to run on. In our Calculator.py file we used app.run(debug=True, host=โ€™0.0.0.0') so we needed to specify which port when using flask run , which above you can see I used 5000.
      image


      FYI: Refer [Source Code] to compute Request/Response like below: image


    • Check Docker Hub: [Docker Hub URL] image

    NOTE: The above service is not meant to be executed on Cloud Environment. To design the project we need various other components like gunicorn which gets dockerize along with the service enabling it to get executed on any Cloud Environment. Follow the below steps:

    • Code the Web Service Project [Source Code]
    • Dockerize the Project:
      image image image image
    • On Azure, Create Resource -> Web -> Web App for Containers
      image image

docker-python's People

Contributors

rahulvaish avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.