From 27aa02383c6fe58814184e785b357446a562162a Mon Sep 17 00:00:00 2001 From: Marius Scurtescu Date: Tue, 20 Feb 2024 15:13:43 -0800 Subject: [PATCH] add .dockerignore and docker instructions (#56) * add .dockerignore * add docker specific readme * update restart policy to unless-stopped --- .dockerignore | 6 ++++++ DOCKER-README.md | 50 ++++++++++++++++++++++++++++++++++++++++++++++ docker-compose.yml | 2 +- 3 files changed, 57 insertions(+), 1 deletion(-) create mode 100644 .dockerignore create mode 100644 DOCKER-README.md diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..6f66701 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,6 @@ +.config +**/.idea +**/.vscode +github.env +Taskfile.yaml + diff --git a/DOCKER-README.md b/DOCKER-README.md new file mode 100644 index 0000000..01f4405 --- /dev/null +++ b/DOCKER-README.md @@ -0,0 +1,50 @@ +# Quilibrium Docker Instructions + +## Build + +Build the docker image: +```shell +docker build -t quilibrium -t quilibrium:1.2.9 . +``` + +Use latest version instead of `1.2.9`. + + +## Run + +Run Quilibrium in a container: +```shell +docker compose up -d +``` + +A `.config/` subfolder will be created under the current folder, this is mapped inside the container. +Make sure you backup `config.ym` and `keys.yml`. + + +## Intereact with a running cotainer + +Drop into a shell inside a running container: +```shell +docker compose exec -it node sh +``` + +Watch the logs: +```shell +docker compose logs +``` + +Get the Peer ID: +```shell +docker compose exec node go run ./... -peer-id +``` + +Get the token ballance: +```shell +docker compose exec node go run ./... -balance +``` + +Run the DB console: +```shell +docker compose exec node go run ./... -db-console +``` + diff --git a/docker-compose.yml b/docker-compose.yml index ad8887e..be21bf6 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -6,7 +6,7 @@ services: node: build: ./ image: quilibrium - restart: always + restart: unless-stopped environment: - DEFAULT_LISTEN_GRPC_MULTIADDR=/ip4/0.0.0.0/tcp/8337 - DEFAULT_LISTEN_REST_MULTIADDR=/ip4/0.0.0.0/tcp/8338