Adopt Compose v2 (#240)
* Adopt Compose v2 Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
This commit is contained in:
@@ -4,14 +4,14 @@
|
||||
Project structure:
|
||||
```
|
||||
.
|
||||
├── docker-compose.yaml
|
||||
├── compose.yaml
|
||||
├── README.md
|
||||
└── sparkjava
|
||||
├── Dockerfile
|
||||
└── ...
|
||||
```
|
||||
|
||||
[_docker-compose.yaml_](docker-compose.yaml)
|
||||
[_compose.yaml_](compose.yaml)
|
||||
```
|
||||
services:
|
||||
sparkjava:
|
||||
@@ -20,13 +20,13 @@ services:
|
||||
- 8080:8080
|
||||
```
|
||||
The compose file defines an application with one service `sparkjava`.
|
||||
When deploying the application, docker-compose maps port 8080 of the sparkjava service container to port 8080 of the host as specified in the file.
|
||||
When deploying the application, docker compose maps port 8080 of the sparkjava service container to port 8080 of the host as specified in the file.
|
||||
Make sure port 8080 on the host is not already being in use.
|
||||
|
||||
## Deploy with docker-compose
|
||||
## Deploy with docker compose
|
||||
|
||||
```
|
||||
$ docker-compose up -d
|
||||
$ docker compose up -d
|
||||
Creating network "sparkjava_default" with the default driver
|
||||
Building sparkjava
|
||||
Step 1/11 : FROM maven:3.6.3-jdk-11 AS build
|
||||
@@ -54,7 +54,7 @@ Hello from Docker!
|
||||
|
||||
Stop and remove the containers
|
||||
```
|
||||
$ docker-compose down
|
||||
$ docker compose down
|
||||
Stopping sparkjava_sparkjava_1 ... done
|
||||
Removing sparkjava_sparkjava_1 ... done
|
||||
Removing network sparkjava_default
|
||||
|
Reference in New Issue
Block a user