To run your nio instance in a docker container you will first need to download your nio binary from the binary downloads page.
- Add a submodule for the default project
git submodule add https://github.com/niolabs/project_template default_project
- Open
default_project/nio.conf
- Find the hostname and token for your pubkeeper server
- If you're using a nio hosted Pubkeeper server, these can be found from the System Designer in the edit modal for your system
- Copy your hostname and token into
PK_HOST
andPK_TOKEN
under theuser_defined
section - Copy your hostname into
WS_HOST
being sure to replacepubkeeper
withwebsocket
- Copy your nio binary wheel into this folder
- Build the docker image passing the wheel filename as a build argument:
docker build -t nio-binary:latest --build-arg WHEEL_FILE=nio_lite-20171127-py3-none-any.whl .
To run the nio binary with an empty project just run the image like so:
docker run -p 8181:8181 nio-binary:latest
You can also volume mount in an existing project directory on disk like so:
docker run -p 8181:8181 -v /path/to/your/project:/nio/project nio-binary:latest
If you see Pubkeeper connection errors or errors like RuntimeError: Client not ready
then that means your instance cannot connect to its Pubkeeper server. Make sure the Pubkeeper connection information is set up correctly in your project's nio.conf
or is being passed in as an environment variable.