According to the testcontainer example the container should be started first. Otherwise it could lead to container port mapping problems.
See: https://github.com/testcontainers/testcontainers-java/blob/main/examples/spring-boot/src/test/java/com/example/AbstractIntegrationTest.java