- Notifications
You must be signed in to change notification settings - Fork10
nanic/python-rest-api-docker
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
steps to run the sample rest service on docker -
Clone the Repository - git clonehttps://github.com/nanic/python-rest-api-docker.git
Move to the directory - cd python-rest-api-docker
Build the docker image - docker build -t python-rest .
Create and run a container - docker run -d -p 5000:5000 python-rest
Navigate tohttp://0.0.0.0:5000/ to get hello world'd
Note: If the image is built inside a private network, you can mention gateway to proxy throughEx: docker build --build-arg proxy=hostname:port -t python-rest .
A Sample Client --
import requestsr = requests.post('http://0.0.0.0:5000/v1/api',verify=False, json={"name": "naren"})headers = {'Content-type': 'application/json'}print(r.status_code)if r.ok:print r.content
About
python
Topics
Resources
Uh oh!
There was an error while loading.Please reload this page.