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

@@ -9,6 +9,7 @@ You can open this sample in the Dev Environments feature of Docker Desktop versi
### PHP application with Apache2
Project structure:
```
.
├── compose.yaml
@@ -19,11 +20,12 @@ Project structure:
```
[_compose.yaml_](compose.yaml)
```
services:
web:
build: app
ports:
ports:
- '80:80'
volumes:
- ./app:/var/www/html/
@@ -32,7 +34,7 @@ services:
## Deploy with docker compose
```
$ docker compose up -d
$ docker-compose up -d
Creating network "php-docker_web" with the default driver
Building web
Step 1/6 : FROM php:7.2-apache
@@ -45,6 +47,7 @@ Creating php-docker_web_1 ... done
## Expected result
Listing containers must show one container running and the port mapping as below:
```
$ docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
@@ -52,12 +55,14 @@ CONTAINER ID IMAGE COMMAND CREATE
```
After the application starts, navigate to `http://localhost:80` in your web browser or run:
```
$ curl localhost:80
Hello World!
```
Stop and remove the containers
```
$ docker compose down
$ docker-compose down
```