Git Product home page Git Product logo

docker-helloworld-flask's Introduction

docker-helloworld-flask

Created simple flask with application then containers application in Docker container image and create a docker repository.

Steps for create flask project

  1. Create virtual environment
  virtualenv env_name
  env_name = virtual environment name.
  1. Create requirements.txt file
Requirements files serve as a list of items to be installed by pip
  1. intall flask
    pip install Flask
  1. Create app.py file
    app.py : this file store application route and entry point of application

Steps for start docker container and deploy in docker hub Repository

  1. create a docker file (Dockerfile)
   Dockerfile : A Dockerfile is a text document that contains all the commands a user could call on the command line to assemble an image 
   command : 
            FROM 
            COPY
            WORKDIR
            RUN
            CMD
        ```
2. create a docker image
```bash
  docker build -t flask-helloworld .
  flask-helloworld >> docker image name
  1. run docker image as a container
  docker run -p 5000:5000 flask-helloworld
  (5000:5000 > host port:container port)  

deploy docker image in docker hub

  1. docker login in docker hub
   docker login
  1. docker image name should be with your docker user name (kaushalpandey/flask-helloworld) 2.1 rename docker image first method
  docker image rm -f flask-helloworld
  (remove old docker image)

  docker build -t kaushalpandey/flask-helloworld . 
  (again create new docker image)

2.2 rename docker image second method

    docker tag flask-helloworld kaushalpandey/flask-helloworld
				(old name)			(new name)
  1. push to docker hub
docker push kaushalpandey/flask-helloworld:latest

docker-helloworld-flask's People

Contributors

kaushalsalvatore avatar

Watchers

 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.