Skip to content

Commit

Permalink
Minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
hibiken committed Apr 6, 2021
1 parent 97a722f commit ec39415
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 9 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,6 @@ package-json.lock
# main binary
asynqmon
dist/

# Editor configs
.vscode/
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,5 @@ docker:
docker run --rm \
--name asynqmon \
-p 8080:8080 \
asynqmon
asynqmon --redis_addr=host.docker.internal:6379

14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ To use the defaults, simply run and open http://localhost:8080.

Pass flags to specify port, redis server address, etc.


```bash
./asynqmon --port=3000 --redis_addr=localhost:6380
```
Expand All @@ -54,7 +53,7 @@ To see all available flags, run

## 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.
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:

Expand All @@ -66,20 +65,21 @@ 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
### Change 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:
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
docker run --rm \
--name asynqmon \
-p 3000:3000 \
asynqmon --port=3000 --redis_addr=localhost:6380
asynqmon --port=3000 --redis_addr=host.docker.internal:6380
```

### Works with a Redis server from Docker
### 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 like `dev-redis`, and our Docker network called `dev-network`, you should run Asynqmon container by this command:
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 \
Expand Down
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ var (

func init() {
flag.IntVar(&flagPort, "port", 8080, "port number to use for web ui server")
flag.StringVar(&flagRedisAddr, "redis_addr", "localhost:6379", "address of redis server to connect to")
flag.StringVar(&flagRedisAddr, "redis_addr", "127.0.0.1:6379", "address of redis server to connect to")
flag.IntVar(&flagRedisDB, "redis_db", 0, "redis database number")
flag.StringVar(&flagRedisPassword, "redis_password", "", "password to use when connecting to redis server")
flag.StringVar(&flagRedisTLS, "redis_tls", "", "server name for TLS validation used when connecting to redis server")
Expand Down

0 comments on commit ec39415

Please sign in to comment.