punchagan/jupyter-fly-deploy
(dumb) Dockerfile based deployment for multiple notebooks to a Fly.io machine
jupyter-fly-deploy
An experimental Dockerfile based method to deploying multiple Jupyter notebooks to a Fly.io machine.
There's no OAuth and user management. Unexpected things could happen if multiple people use the server at the same time.
Usage
-
Use this repository as a template (button on GitHub) to create your own
copy of it. -
Setup an account on fly.io
-
Run `fly auth login``
-
Run
fly launch --generate-name --no-deploy.Answer
yto use existing config. -
Remove
project_a/directories and create separate directories for your own
notebooks. The directories should contain arequirements.txtif it
contains a notebook directory. It can be empty if you don't need any
additional dependencies other than Jupyter notebook. -
The Jupyter starts each time with a random token which could be a problem,
if you'd like to share URLs with others. You could instead set the
JUPYTER_TOKEN environment variable using thefly secrets set JUPYTER_TOKEN="some-long-secret"command. -
Run
fly deployto deploy your changes. -
You can share links to individual notebooks using the token you set above, as follows:
https://<app-name>.fly.dev/notebooks/<dir>/<notebook_name>.ipynb?token=some-long-secret -
(Optional) You can setup the app to be automatically
deployed
on future pushes to GitHub using GitHub actions by creating a Fly token and
adding it to the repository's settings. The GitHub workflow file is already
present.