jupyterkgdemo.ipynb /var/jupyterkgdemo.ipynbĬMD This is probably all overkill but it make for a literate definition of your API defining code…Ĭreate a new directory – jupyterkgdemo and copy the following Jupyter notebook into it ( gist/psychemedia/jupyterkgdemo.ipynb):Īdd the following Dockerfile: FROM python:3.5-slim-stretchĬOPY. This demo shows how to knock up an API server where the API is defined in a Jupyter notebook and published using the Jupyter Kernel Gateway (see also Building a JSON API Using Jupyter Notebooks in Under 5 Minutes). It’s not quite as easy as Zeit Now though… Docker demo – Jupyter notebook powered API Note that as well as deploying to my local docker instance, the docker-machine command line application also allows me to launch remote servers (for example, on Digital Ocean) and then build/deploy the container there ( old example). run the container with: docker run -d -p 8087:5005 myflaskdemo and you should see a hello message on port 8087.Ĭompare this with what I had to do to get a flask app running via the Reclaim CPanel.is important – it says “the path to the Dockerfile is the current directory) on the command line, cd into the directory and then build the Docker container with the command docker build -t myflaskdemo. If you prefer, and have docker installed locally: This first demo creates a simple flask app and a Dockerfile with just enough to get it running it runs locally if you have docker installed locally, and will also run on Zeit Now.Ĭreate a new directory – flaskdemo – and create a couple of files in it, specifically:ĭownload and run the Zeit Now application, then on the command line cd into the flaskdemo folder and type: now to launch the application and now ls to lookup the URL where it’s running. Some simple recipes for getting started with running some demo virtual applications in variety of ways.
0 Comments
Leave a Reply. |