docs: update docs of README.mds.
summary: update command docker compose to docker-compose.
This commit is contained in:
@@ -23,10 +23,10 @@ Project structure:
|
||||
|
||||
```
|
||||
services:
|
||||
redis:
|
||||
redis:
|
||||
image: redislabs/redismod
|
||||
ports:
|
||||
- '6379:6379'
|
||||
- '6379:6379'
|
||||
web:
|
||||
build: .
|
||||
ports:
|
||||
@@ -40,31 +40,33 @@ services:
|
||||
## Deploy with docker compose
|
||||
|
||||
```
|
||||
$ docker compose up -d
|
||||
$ docker-compose up -d
|
||||
[+] Running 24/24
|
||||
⠿ redis Pulled
|
||||
...
|
||||
⠿ 565225d89260 Pull complete
|
||||
⠿ redis Pulled
|
||||
...
|
||||
⠿ 565225d89260 Pull complete
|
||||
[+] Building 12.7s (10/10) FINISHED
|
||||
=> [internal] load build definition from Dockerfile ...
|
||||
[+] Running 3/3
|
||||
⠿ Network flask-redis_default Created
|
||||
⠿ Container flask-redis-redis-1 Started
|
||||
⠿ Network flask-redis_default Created
|
||||
⠿ Container flask-redis-redis-1 Started
|
||||
⠿ Container flask-redis-web-1 Started
|
||||
```
|
||||
|
||||
## Expected result
|
||||
|
||||
Listing containers must show one container running and the port mapping as below:
|
||||
|
||||
```
|
||||
|
||||
$ docker compose ps
|
||||
$ docker-compose ps
|
||||
NAME COMMAND SERVICE STATUS PORTS
|
||||
flask-redis-redis-1 "redis-server --load…" redis running 0.0.0.0:6379->6379/tcp
|
||||
flask-redis-web-1 "/bin/sh -c 'python …" web running 0.0.0.0:8000->8000/tcp
|
||||
```
|
||||
|
||||
After the application starts, navigate to `http://localhost:8000` in your web browser or run:
|
||||
|
||||
```
|
||||
$ curl localhost:8000
|
||||
This webpage has been viewed 2 time(s)
|
||||
@@ -72,7 +74,8 @@ This webpage has been viewed 2 time(s)
|
||||
|
||||
## Monitoring Redis keys
|
||||
|
||||
Connect to redis database by using ```redis-cli``` command and monitor the keys.
|
||||
Connect to redis database by using `redis-cli` command and monitor the keys.
|
||||
|
||||
```
|
||||
redis-cli -p 6379
|
||||
127.0.0.1:6379> monitor
|
||||
@@ -81,8 +84,8 @@ OK
|
||||
1646634062.735669 [0 172.21.0.3:33106] "GET" "hits"
|
||||
```
|
||||
|
||||
|
||||
Stop and remove the containers
|
||||
|
||||
```
|
||||
$ docker compose down
|
||||
$ docker-compose down
|
||||
```
|
||||
|
Reference in New Issue
Block a user