docs: update docs of README.mds.
summary: update command docker compose to docker-compose.
This commit is contained in:
@@ -9,6 +9,7 @@ You can open this sample in the Dev Environments feature of Docker Desktop versi
|
||||
### React application with a Spring backend and a MySQL database
|
||||
|
||||
Project structure:
|
||||
|
||||
```
|
||||
.
|
||||
├── backend
|
||||
@@ -24,6 +25,7 @@ Project structure:
|
||||
```
|
||||
|
||||
[_compose.yaml_](compose.yaml)
|
||||
|
||||
```
|
||||
services:
|
||||
backend:
|
||||
@@ -41,6 +43,7 @@ services:
|
||||
- 3000:3000
|
||||
...
|
||||
```
|
||||
|
||||
The compose file defines an application with three services `frontend`, `backend` and `db`.
|
||||
When deploying the application, docker compose maps port 3000 of the frontend service container to port 3000 of the host as specified in the file.
|
||||
Make sure port 3000 on the host is not already being in use.
|
||||
@@ -53,7 +56,7 @@ Make sure port 3000 on the host is not already being in use.
|
||||
## Deploy with docker compose
|
||||
|
||||
```
|
||||
$ docker compose up -d
|
||||
$ docker-compose up -d
|
||||
Creating network "react-java-mysql-default" with the default driver
|
||||
Building backend
|
||||
Step 1/17 : FROM maven:3.6.3-jdk-11 AS builder
|
||||
@@ -68,6 +71,7 @@ Creating react-java-mysql-backend-1 ... done
|
||||
## Expected result
|
||||
|
||||
Listing containers must show three containers running and the port mapping as below:
|
||||
|
||||
```
|
||||
$ docker ps
|
||||
ONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
|
||||
@@ -80,8 +84,9 @@ After the application starts, navigate to `http://localhost:3000` in your web br
|
||||

|
||||
|
||||
Stop and remove the containers
|
||||
|
||||
```
|
||||
$ docker compose down
|
||||
$ docker-compose down
|
||||
Stopping react-java-mysql-backend-1 ... done
|
||||
Stopping react-java-mysql-frontend-1 ... done
|
||||
Stopping react-java-mysql-db-1 ... done
|
||||
|
Reference in New Issue
Block a user