简体   繁体   中英

Python API to call Docker container endpoint

I am new to python and Docker. I have a LUIS endpoint on Azure and I have containerized it on docker on my localhost listening to port 5000. Now I need to create a python web api, that will call this (LUIS container) docker endpoint.

How to achieve this?

You can take a look at: https://docker-py.readthedocs.io/en/stable/

Looks like you an create containers with. https://docker-py.readthedocs.io/en/stable/containers.html

You already have an endpoint hosted in a Docker container? Now you need a python script that calls that endpoint? Then I think you need the requests container. Best is to put your API credentials in environment variables which you can get with: os.environ: docs.python.org/3/library/os.html#os.environ

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM