Skip to content

jwang1122/docker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 

Repository files navigation

Build simple docker container

Docker tutorial

First Pythong web application

  1. install flask
pip install flask
pip install flask_restful
  1. create api.py
from flask import Flask
from flask_restful import Resource, Api

app = Flask(__name__)
api = Api(app)

class Product(Resource):
    def get(self):
        return{
            'product': ['Ice cream',
                        'Chocolate',
                        'fruite']
        }

api.add_resource(Product, '/')

if __name__ == '__main__':
    app.run(host='0.0.0.0', port=80, debug=True)
  1. run the application
sudo python api.py
password: qianjiang
  1. stop the application: Ctrl+c

About

learn docker

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages