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,6 +1,7 @@
## Compose sample application: ASP.NET with MS SQL server database
Project structure:
```
.
├── app
@@ -13,6 +14,7 @@ Project structure:
```
[_compose.yaml_](compose.yaml)
```
services:
web:
@@ -26,6 +28,7 @@ services:
#image: mcr.microsoft.com/mssql/server
...
```
The compose file defines an application with two services `web` and `db`. The image for the web service is built with the Dockerfile inside the `app` directory (build parameter).
When deploying the application, docker compose maps the container port 80 to port 80 of the host as specified in the file.
@@ -33,13 +36,13 @@ Make sure port 80 on the host is not being used by another container, otherwise
> **_INFO_**
> For compatibility purpose between `AMD64` and `ARM64` architecture, we use Azure SQL Edge as database instead of MS SQL Server.
> You still can use the MS SQL Server image by uncommenting the following line in the Compose file
> You still can use the MS SQL Server image by uncommenting the following line in the Compose file
> `#image: mcr.microsoft.com/mssql/server`
## Deploy with docker compose
```
$ docker compose up -d
$ docker-compose up -d
Creating network "aspnet-mssql_default" with the default driver
Building web
Step 1/13 : FROM mcr.microsoft.com/dotnet/sdk:5.0 AS build
@@ -53,10 +56,10 @@ Creating aspnet-mssql_web_1 ... done
Creating aspnet-mssql_db_1 ... done
```
## 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
@@ -71,5 +74,5 @@ After the application starts, navigate to `http://localhost:80` in your web brow
Stop and remove the containers
```
$ docker compose down
$ docker-compose down
```