Skip to content

Commit 3806235

Browse files
jonathanvilaJonathan Vila
authored andcommitted
Added documentation example of using local Docker Compose (#1987)
Co-authored-by: Jonathan Vila <[email protected]>
1 parent c27f401 commit 3806235

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

docs/modules/docker_compose.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,13 @@ public static DockerComposeContainer environment =
112112

113113
You can override Testcontainers' default behaviour and make it use a `docker-compose` binary installed on the local machine.
114114
This will generally yield an experience that is closer to running docker-compose locally, with the caveat that Docker Compose needs to be present on dev and CI machines.
115-
115+
```java
116+
public static DockerComposeContainer environment =
117+
new DockerComposeContainer(new File("src/test/resources/compose-test.yml"))
118+
.withExposedService("redis_1", REDIS_PORT, Wait.forListeningPort())
119+
.waitingFor("db_1", Wait.forLogMessage("started", 1))
120+
.withLocalCompose(true);
121+
```
116122
## Using private repositories in Docker compose
117123
When Docker Compose is used in container mode (not local), it's needs to be made aware of Docker settings for private repositories.
118124
By default, those setting are located in `$HOME/.docker/config.json`.

0 commit comments

Comments
 (0)