diff options
author | icebaker <icebaker@proton.me> | 2023-05-11 22:12:16 -0300 |
---|---|---|
committer | icebaker <icebaker@proton.me> | 2023-05-11 22:12:16 -0300 |
commit | 0bb22299298bac97a4112dd93f7482b3fbbc9bc8 (patch) | |
tree | d07eba6e0728f70a136ac0d031cc0370bd5f96b6 | |
parent | 5bca2bbd6a57c46126a657a912e796e2a4282c28 (diff) |
adding docker support
-rw-r--r-- | .gitignore | 1 | ||||
-rw-r--r-- | README.md | 38 | ||||
-rw-r--r-- | docker-compose.example.yml | 12 |
3 files changed, 51 insertions, 0 deletions
@@ -1,2 +1,3 @@ .env *.gem +docker-compose.yml @@ -8,6 +8,7 @@ _Image artificially created by Midjourney through a prompt generated by a Nano B https://user-images.githubusercontent.com/113217272/237840989-1e29a5cc-6644-48d0-87b4-62798dc6ebd3.mp4 - [Setup](#setup) + - [Docker](#docker) - [Usage](#usage) - [Command Line](#command-line) - [Library](#library) @@ -46,6 +47,43 @@ export NANO_BOTS_CARTRIDGES_DIRECTORY=/home/user/.local/share/nano-bots/cartridg Alternatively, if your current directory has a `.env` file with the environment variables, they will be automatically loaded. +## Docker + +Clone the repository and copy the Docker Compose template: + +``` +git clone git@github.com:icebaker/ruby-nano-bots.git +cd ruby-nano-bots +cp docker-compose.example.yml docker-compose.yml +``` + +Set your provider credentials and choose your desired directory for the cartridges files: + +```yaml +version: '3.7' + +services: + nano-bots: + image: ruby:3.2.2-slim-bullseye + command: sh -c "gem install nano-bots -v 0.0.1 && bash" + environment: + OPENAI_API_ADDRESS: https://api.openai.com + OPENAI_API_ACCESS_TOKEN: your-token + OPENAI_API_USER_IDENTIFIER: your-user + volumes: + - ./your-cartridges:/cartridges +``` + +Enter the container: +```sh +docker compose run nano-bots +``` + +Start playing: +```sh +rnb cartridges/assistant.yml - repl +``` + ## Usage ### Command Line diff --git a/docker-compose.example.yml b/docker-compose.example.yml new file mode 100644 index 0000000..0129c74 --- /dev/null +++ b/docker-compose.example.yml @@ -0,0 +1,12 @@ +version: '3.7' + +services: + nano-bots: + image: ruby:3.2.2-slim-bullseye + command: sh -c "gem install nano-bots -v 0.0.1 && bash" + environment: + OPENAI_API_ADDRESS: https://api.openai.com + OPENAI_API_ACCESS_TOKEN: your-token + OPENAI_API_USER_IDENTIFIER: your-user + volumes: + - ./your-cartridges:/cartridges |