API for serving models developed for Panelais.
sudo apt update
sudo apt install python3 python3-pip nodejs npm -y
sudo npm install -g pm2
For running directly the application in a "raw" way:
sudo python3 -m pip install pip --upgrade
sudo python3 -m pip install . --upgrade
sudo panelais_models_api
Application can be launched with the launch script:
sudo bash launch.sh
Note: if the script launch.sh
doesn't works, you can use launch2.sh
instead.
Application can be launched in background as a production service with PM2 tool:
sudo pm2 start pm2.json
Application can be also deployed with docker. For that purpose, first build and push the application:
docker build . -t <your dockerhub user>/panelais-api
docker push <your dockerhub user>/panelais-api
Then in the enviroment where application must be deplolyed, pull changes and deploy:
docker pull <your dockerhub user>/panelais-api
docker run -p 5000:<your-published-port> <your dockerhub user>/panelais-api
There is a GitHub Actions automatic CI deployment located in .github/workflows/docker-deploy
. This one, builds the docker image on each push into main branch, and pushes it to dockerhub. For using this deployment, is neccesary to define a repository secret called DOCKERHUB_TOKEN
, with the personal dockerhub token.
For make easier the integration, the API deploys a swagger interface. Also in the repository there is a postman collection in integration/panelais-models-api-api.postman_collection.json
, which you can generate the request with for any language included in the postman client.
Component developed by Francisco Pinto-Santos (@Gandalfran on GitHub) on 2023. For manteinance and bug reports please contact the developer at [email protected]. Copyright BISITE 2023. All rights reserved. See license for details.