Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve Docker Compose docs #9461

Merged

Conversation

etrandafir93
Copy link
Contributor

Restructure documentation for the Docker Compose module, focusing on:

  • focus on ComposeContainer instead of DockerComposeContainer as the primary source of examples.
    (current doc uses DockerComposeContainer in the majority of the code snippets)

  • keep the code samples independent from the JUnit execution
    (the code examples include JUnit4's @ClassRule)

  • use MkDocsfor the code snippets wherever possible
    (currently, the code samples are written as code blocks in markdown, instead of using MkDocs)

  • add links to Javadoc and to other documentation pages wherever possible

Page to be modified: https://java.testcontainers.org/modules/docker_compose/


import static org.assertj.core.api.Assertions.assertThat;

public class ComposeContainerDocTest {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we can use existing examples instead of adding new test just for docs.

This comment was marked as outdated.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@eddumelendez - I've pushed some changes now, trying to make as much as possible from the existing tests

Copy link
Member

@eddumelendez eddumelendez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the update. Please, follow https://sembr.org/ and let's instead highlight only or point to our own documentation rather than javadoc.io.


Behind the scenes, Testcontainers actually launches a temporary Docker Compose client - in a container, of course, so
it's not necessary to have it installed on all developer/test machines.
The [`ComposeContainer`](http://static.javadoc.io/org.testcontainers/testcontainers/{{ latest_version }}/org/testcontainers/containers/ComposeContainer.html) leverages [Compose V2](https://www.docker.com/blog/announcing-compose-v2-general-availability/), making it easy to use the same dependencies from the development environment within tests.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
The [`ComposeContainer`](http://static.javadoc.io/org.testcontainers/testcontainers/{{ latest_version }}/org/testcontainers/containers/ComposeContainer.html) leverages [Compose V2](https://www.docker.com/blog/announcing-compose-v2-general-availability/), making it easy to use the same dependencies from the development environment within tests.
The `ComposeContainer` leverages [Compose V2](https://www.docker.com/blog/announcing-compose-v2-general-availability/), making it easy to use the same dependencies from the development environment within tests.

docs/modules/docker_compose.md Outdated Show resolved Hide resolved
docs/modules/docker_compose.md Outdated Show resolved Hide resolved
docs/modules/docker_compose.md Outdated Show resolved Hide resolved
docs/modules/docker_compose.md Outdated Show resolved Hide resolved
docs/modules/docker_compose.md Outdated Show resolved Hide resolved
docs/modules/docker_compose.md Outdated Show resolved Hide resolved
@etrandafir93
Copy link
Contributor Author

@eddumelendez, when you have a few minutes, can you please let me know if I can help with anything else here? - cheers :)

docs/modules/docker_compose.md Outdated Show resolved Hide resolved
docs/modules/docker_compose.md Outdated Show resolved Hide resolved
docs/modules/docker_compose.md Outdated Show resolved Hide resolved
docs/modules/docker_compose.md Outdated Show resolved Hide resolved
docs/modules/docker_compose.md Outdated Show resolved Hide resolved
docs/modules/docker_compose.md Outdated Show resolved Hide resolved
docs/modules/docker_compose.md Outdated Show resolved Hide resolved
@eddumelendez eddumelendez changed the title Restructure Docs for Docker Compose Improve Docker Compose docs Nov 26, 2024
@eddumelendez eddumelendez merged commit de3d2d3 into testcontainers:main Nov 26, 2024
105 checks passed
@eddumelendez
Copy link
Member

Thanks for your contribution, @etrandafir93 ! and sorry for the delay.

@eddumelendez eddumelendez added this to the next milestone Nov 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants