Пример структуры python библиотеки + REST API сервис
git clone https://github.com/albellov/snippet.git
3. Установить зависимости
pip install -r requirements.txt
docker build -t snippet-service:latest --no-cache .
docker run -dp 8080:8080 snippet-service:latest
import requests
url = 'http://localhost:8080'
res = requests.get(url + '/api/v1/ping')
print(res.content.decode())
import requests
import json
url = 'http://localhost:8080'
res = requests.post(url + '/api/v1/predict', json={'count': 5, 'user_id': '125235235235'})
print(json.loads(res.content.decode()))