Skip to content

Commit

Permalink
docs: update README.md file and improve installation instructions (#486)
Browse files Browse the repository at this point in the history
- Fix a typo in the README.md file
- Update the command for installing air
- Add a new example for running a project in Docker
- Update the link for "Buy Me A Coffee" in the README.md file

Signed-off-by: Bo-Yi Wu <[email protected]>
  • Loading branch information
appleboy authored Oct 20, 2023
1 parent 05e48a7 commit 1a1ff4e
Showing 1 changed file with 16 additions and 13 deletions.
29 changes: 16 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ Note: This tool has nothing to do with hot-deploy for production.
* Allow watching new directories after Air started
* Better building process

### Overwrite specify configuration from arguments:
### Overwrite specify configuration from arguments

Support air config fields as arguments:

Expand Down Expand Up @@ -72,7 +72,6 @@ curl -sSfL https://goblin.run/github.com/cosmtrek/air | PREFIX=/tmp sh

### Docker/Podman


Please pull this docker image [cosmtrek/air](https://hub.docker.com/r/cosmtrek/air).

```bash
Expand All @@ -84,15 +83,17 @@ docker/podman run -it --rm \
cosmtrek/air
-c <CONF>
```

#### Docker/Podman .${SHELL}rc

if you want to use air continuously like a normal app, you can create a function in your ${SHELL}rc (bash,zsh,etc...)

```bash
air() {
podman/docker run -it --rm \
-w "$PWD" -v "$PWD":"$PWD" \
-p "$AIR_PORT":"$AIR_PORT" \
docker.io/cosmtrek/air "$@"
podman/docker run -it --rm \
-w "$PWD" -v "$PWD":"$PWD" \
-p "$AIR_PORT":"$AIR_PORT" \
docker.io/cosmtrek/air "$@"
}
```

Expand All @@ -102,21 +103,23 @@ if you want to enter the container, Please add --entrypoint=bash.
<details>
<summary>For example</summary>

- One of my project runs in docker:
One of my project runs in docker:

```bash
docker run -it --rm \
-w "/go/src/github.com/cosmtrek/hub" \
-v $(pwd):/go/src/github.com/cosmtrek/hub \
-p 9090:9090 \
cosmtrek/air
-w "/go/src/github.com/cosmtrek/hub" \
-v $(pwd):/go/src/github.com/cosmtrek/hub \
-p 9090:9090 \
cosmtrek/air
```

- Another example:
Another example:

```bash
cd /go/src/github.com/cosmtrek/hub
AIR_PORT=8080 air -c "config.toml"
```

this will replace `$PWD` with the current directory, `$AIR_PORT` is the port where to publish and `$@` is to accept arguments of the aplication itself for example -c

</details>
Expand Down Expand Up @@ -288,7 +291,7 @@ git push origin v1.xx.x

## Sponsor

<a href="https://www.buymeacoffee.com/cosmtrek" target="_blank"><img src="https://cdn.buymeacoffee.com/buttons/default-orange.png" alt="Buy Me A Coffee" style="height: 51px !important;width: 217px !important;" ></a>
[![Buy Me A Coffee](https://cdn.buymeacoffee.com/buttons/default-orange.png)](https://www.buymeacoffee.com/cosmtrek)

Give huge thanks to lots of supporters. I've always been remembering your kindness.

Expand Down

0 comments on commit 1a1ff4e

Please sign in to comment.