2
0
mirror of https://github.com/hibiken/asynqmon.git synced 2025-10-26 16:26:12 +08:00

Add option to use Docker container to run Asynqmon

This commit is contained in:
Vic Shóstak
2021-04-06 02:35:15 +03:00
committed by GitHub
parent ecedc3372c
commit 1e8a573f8f
8 changed files with 178 additions and 40 deletions

View File

@@ -22,8 +22,8 @@ installed in order to build the frontend assets.
Download the source code and then run:
```sh
$ make build
```bash
make build
```
The `asynqmon` binary should be created in the current directory.
@@ -35,20 +35,58 @@ By default, it connects to redis server running on port 6379 locally, and the se
To use the defaults, simply run and open http://localhost:8080.
```sh
$ asynqmon
```bash
./asynqmon
```
Pass flags to specify port, redis server address, etc.
```sh
$ asynqmon --port=3000 --redis_addr=localhost:6380
```bash
./asynqmon --port=3000 --redis_addr=localhost:6380
```
To see all available flags, run
```sh
$ asynqmon --help
```bash
./asynqmon --help
```
## Running from Docker
To run Asynqmon in Docker container, you only need to install [Docker](https://www.docker.com/get-started) to your system. No need to install [Node.js](https://nodejs.org/) and [Yarn](https://yarnpkg.com/), they will be installed automatically in container.
After that, just run this command:
```bash
make docker
```
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)
### Change a default Asynqmon settings
By default, Asynqmon runs on `http://localhost:8080` and waiting to connect to the Redis server on port `6379`. You can easily change this settings by running Docker container with custom options, like this:
```bash
docker run --rm \
--name asynqmon \
-p 3000:3000 \
asynqmon --port=3000 --redis_addr=localhost:6380
```
### Works with 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 like `dev-redis`, and our Docker network called `dev-network`, you should run Asynqmon container by this command:
```bash
docker run --rm \
--name asynqmon \
--network dev-network \
-p 8080:8080 \
asynqmon --redis_addr=dev-redis:6379
```
## License