Run your jupyter notebooks as a REST API endpoint. This isn't a jupyter server but rather just a way to run your notebooks as a REST API Endpoint.
mkdir rest-project
cd rest-project
git clone https://github.com/Invictify/Jupter-Notebook-REST-API .
pipenv install
pipenv shell
You can also use
pip install -r requirements.txt
There's an example notebook already in there called scrape.ipynb
.
pipenv run uvicorn src.server:app --reload
You can also do:
chmod +x run.sh
./run.sh
With the server running, trigger notebook (relative path) like notebooks/scrape.ipynb
import requests
r = requests.post("http://localhost:8000/trigger/notebooks/scrape.ipynb")
print(r.json())
You'll only have to do this 1 time.
heroku apps:create
git init
git add --all
git commit -m "Project commit"
git push heroku master
heroku container:login
docker build -t -f Dockerfile.web .
heroku container:push web --recursive
heroku container:release web