diff --git a/.gitignore b/.gitignore index faee483..b9d1bb6 100644 --- a/.gitignore +++ b/.gitignore @@ -26,3 +26,6 @@ package-json.lock # main binary asynqmon dist/ + +# Editor configs +.vscode/ diff --git a/Makefile b/Makefile index 536dd47..b7b386f 100644 --- a/Makefile +++ b/Makefile @@ -20,5 +20,5 @@ docker: docker run --rm \ --name asynqmon \ -p 8080:8080 \ - asynqmon + asynqmon --redis_addr=host.docker.internal:6379 diff --git a/README.md b/README.md index e750e81..43dc020 100644 --- a/README.md +++ b/README.md @@ -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 ``` @@ -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: @@ -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 \ diff --git a/main.go b/main.go index e1738c0..355b9fd 100644 --- a/main.go +++ b/main.go @@ -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")