From d1f3ca461ca2f7e13e065c457539e324c110161a Mon Sep 17 00:00:00 2001 From: Ken Hibino Date: Tue, 6 Apr 2021 21:03:14 -0700 Subject: [PATCH] Update readme --- README.md | 94 ++++++++++++++++++++++++++++++------------------------- 1 file changed, 52 insertions(+), 42 deletions(-) diff --git a/README.md b/README.md index 43dc020..365f390 100644 --- a/README.md +++ b/README.md @@ -6,13 +6,25 @@ Asynqmon is a web based tool for monitoring and administrating Asynq queues and Current version of Asynqmon is compatible with [Asynq v0.15 or above](https://github.com/hibiken/asynq/releases). -## Installation +## Install ### Release binaries You can download the release binary for your system from the [releases page](https://github.com/hibiken/asynqmon/releases). +### Docker image + +To pull the docker image: + +```bash +# Pull the latest image +docker pull hibiken/asynqmon + +# Or specify the image by tag +docker pull hibiken/asynqmon[:tag] +``` + ### Building from source To build Asynqmon from source code, first ensure that have a working @@ -28,60 +40,44 @@ make build The `asynqmon` binary should be created in the current directory. -## Usage +### Building docker image -Asynqmon server needs to connect to redis server to serve data. -By default, it connects to redis server running on port 6379 locally, and the server listens on port 8080. - -To use the defaults, simply run and open http://localhost:8080. - -```bash -./asynqmon -``` - -Pass flags to specify port, redis server address, etc. - -```bash -./asynqmon --port=3000 --redis_addr=localhost:6380 -``` - -To see all available flags, run - -```bash -./asynqmon --help -``` - -## Running from Docker - -To run Asynqmon in a Docker container, you only need to install [Docker](https://www.docker.com/get-started) on your system. No need to install [Node.js](https://nodejs.org/) and [Yarn](https://yarnpkg.com/), they will be installed automatically in the container. - -After that, just run this command: +To build docker image locally, run: ```bash make docker ``` -Next, go to [localhost:8080](http://localhost:8080) and see Asynqmon dashboard: +## Run -![Screenshot](https://user-images.githubusercontent.com/11155743/113557216-57af2b80-9606-11eb-8ab6-df023b14e5c1.png) - -### Change default Asynqmon settings - -By default, Asynqmon web server listens on `http://localhost:8080` and connects to a Redis server on port `localhost:6379`. -You can easily change this settings by running Docker container with custom options, like this: +To use the defaults, simply run and open http://localhost:8080. ```bash +# with a local binary +./asynqmon + +# with docker +docker run --rm \ + --name asynqmon \ + -p 8080:8080 \ + hibiken/asynqmon +``` + +By default, Asynqmon web server listens on port `8080` and connects to a Redis server listening on `127.0.0.1:6379`. + +Pass flags to specify port, redis server address, etc. + +```bash +# with a local binary +./asynqmon --port=3000 --redis_addr=localhost:6380 + +# with docker (connect to redis-server running on the host machine) docker run --rm \ --name asynqmon \ -p 3000:3000 \ - asynqmon --port=3000 --redis_addr=host.docker.internal:6380 -``` + hibiken/asynqmon --port=3000 --redis_addr=host.docker.internal:6380 -### Connect to a Redis server from Docker - -If you run Redis server from Docker container too (i.e. is **not** locally installed to your machine), you need to set [Docker network](https://docs.docker.com/network/) to make them work together. For example, if Redis container have a name `dev-redis`, and our Docker network called `dev-network`, you should run Asynqmon container by this command: - -```bash +# with docker (connect to redis-server running in a docker container) docker run --rm \ --name asynqmon \ --network dev-network \ @@ -89,6 +85,20 @@ docker run --rm \ asynqmon --redis_addr=dev-redis:6379 ``` +To see all available flags, run + +```bash +# with a local binary +./asynqmon --help + +# with docker +docker run hibiken/asynqmon --help +``` + +Next, go to [localhost:8080](http://localhost:8080) and see Asynqmon dashboard: + +![Screenshot](https://user-images.githubusercontent.com/11155743/113557216-57af2b80-9606-11eb-8ab6-df023b14e5c1.png) + ## License Asynqmon is released under the MIT license. See [LICENSE](https://github.com/hibiken/asynqmon/blob/master/LICENSE).