docs: update docs of README.mds.

summary: update command docker compose to docker-compose.
This commit is contained in:
Mark
2023-01-05 22:29:01 +08:00
parent 20e3e4c434
commit 4b0c67e2aa
40 changed files with 518 additions and 332 deletions

View File

@@ -1,7 +1,9 @@
## Compose sample
### Prometheus & Grafana
Project structure:
```
.
├── compose.yaml
@@ -13,6 +15,7 @@ Project structure:
```
[_compose.yaml_](compose.yaml)
```
services:
prometheus:
@@ -26,6 +29,7 @@ services:
ports:
- 3000:3000
```
The compose file defines a stack with two services `prometheus` and `grafana`.
When deploying the stack, docker compose maps port the default ports for each service to the equivalent ports on the host in order to inspect easier the web interface of each service.
Make sure the ports 9090 and 3000 on the host are not already in use.
@@ -33,7 +37,7 @@ Make sure the ports 9090 and 3000 on the host are not already in use.
## Deploy with docker compose
```
$ docker compose up -d
$ docker-compose up -d
Creating network "prometheus-grafana_default" with the default driver
Creating volume "prometheus-grafana_prom_data" with default driver
...
@@ -46,6 +50,7 @@ Attaching to prometheus, grafana
## Expected result
Listing containers must show two containers running and the port mapping as below:
```
$ docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
@@ -60,6 +65,7 @@ Navigate to `http://localhost:3000` in your web browser and use the login creden
Navigate to `http://localhost:9090` in your web browser to access directly the web interface of prometheus.
Stop and remove the containers. Use `-v` to remove the volumes if looking to erase all data.
```
$ docker compose down -v
$ docker-compose down -v
```