mirror of https://github.com/docker/docs.git
- fixed typo on yml file.
- added quotes to ports identification as per good practices
This commit is contained in:
parent
a7282b10b4
commit
b1563e8c4e
|
@ -128,25 +128,25 @@ Open the `petclinic` in your IDE or a text editor and create a new file named `d
|
||||||
```yaml
|
```yaml
|
||||||
version: '3.8'
|
version: '3.8'
|
||||||
services:
|
services:
|
||||||
petclinic:
|
petclinic:
|
||||||
build:
|
build:
|
||||||
context: .
|
context: .
|
||||||
target: development
|
target: development
|
||||||
ports:
|
ports:
|
||||||
- 8000:8000
|
- "8000:8000"
|
||||||
- 8080:8080
|
- "8080:8080"
|
||||||
environment:
|
environment:
|
||||||
- SERVER_PORT=8080
|
- SERVER_PORT=8080
|
||||||
- MYSQL_URL=jdbc:mysql://mysqlserver/petclinic
|
- MYSQL_URL=jdbc:mysql://mysqlserver/petclinic
|
||||||
volumes:
|
volumes:
|
||||||
- ./:/app
|
- ./:/app
|
||||||
depends_on:
|
depends_on:
|
||||||
- mysqlserver
|
- mysqlserver
|
||||||
|
|
||||||
mysqlserver:
|
mysqlserver:
|
||||||
image: mysql:8.0
|
image: mysql:8.0
|
||||||
ports:
|
ports:
|
||||||
- 3306:3306
|
- "3306:3306"
|
||||||
environment:
|
environment:
|
||||||
- MYSQL_ROOT_PASSWORD=
|
- MYSQL_ROOT_PASSWORD=
|
||||||
- MYSQL_ALLOW_EMPTY_PASSWORD=true
|
- MYSQL_ALLOW_EMPTY_PASSWORD=true
|
||||||
|
@ -157,8 +157,8 @@ services:
|
||||||
- mysql_data:/var/lib/mysql
|
- mysql_data:/var/lib/mysql
|
||||||
- mysql_config:/etc/mysql/conf.d
|
- mysql_config:/etc/mysql/conf.d
|
||||||
volumes:
|
volumes:
|
||||||
mysql_data:
|
mysql_data:
|
||||||
mysql_config:
|
mysql_config:
|
||||||
```
|
```
|
||||||
|
|
||||||
This Compose file is super convenient as we do not have to type all the parameters to pass to the `docker run` command. We can declaratively do that using a Compose file.
|
This Compose file is super convenient as we do not have to type all the parameters to pass to the `docker run` command. We can declaratively do that using a Compose file.
|
||||||
|
|
Loading…
Reference in New Issue