Update readme

This commit is contained in:
Ken Hibino 2021-04-06 21:03:14 -07:00
parent ec394155e9
commit d1f3ca461c

View File

@ -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). Current version of Asynqmon is compatible with [Asynq v0.15 or above](https://github.com/hibiken/asynq/releases).
## Installation ## Install
### Release binaries ### Release binaries
You can download the release binary for your system from the You can download the release binary for your system from the
[releases page](https://github.com/hibiken/asynqmon/releases). [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 ### Building from source
To build Asynqmon from source code, first ensure that have a working 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. 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. To build docker image locally, run:
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:
```bash ```bash
make docker 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) To use the defaults, simply run and open http://localhost:8080.
### 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:
```bash ```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 \ docker run --rm \
--name asynqmon \ --name asynqmon \
-p 3000:3000 \ -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 # with docker (connect to redis-server running in a docker container)
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
docker run --rm \ docker run --rm \
--name asynqmon \ --name asynqmon \
--network dev-network \ --network dev-network \
@ -89,6 +85,20 @@ docker run --rm \
asynqmon --redis_addr=dev-redis:6379 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 ## License
Asynqmon is released under the MIT license. See [LICENSE](https://github.com/hibiken/asynqmon/blob/master/LICENSE). Asynqmon is released under the MIT license. See [LICENSE](https://github.com/hibiken/asynqmon/blob/master/LICENSE).