diff --git a/README.md b/README.md index bb3fe977fd3..f1594013a17 100644 --- a/README.md +++ b/README.md @@ -64,16 +64,16 @@ docker run -e POSTGRES_USER=petclinic -e POSTGRES_PASSWORD=petclinic -e POSTGRES Further documentation is provided for [MySQL](https://github.com/spring-projects/spring-petclinic/blob/main/src/main/resources/db/mysql/petclinic_db_setup_mysql.txt) and [PostgreSQL](https://github.com/spring-projects/spring-petclinic/blob/main/src/main/resources/db/postgres/petclinic_db_setup_postgres.txt). -Instead of vanilla `docker` you can also use the provided `docker-compose.yml` file to start the database containers. Each one has a profile just like the Spring profile: +Instead of vanilla `docker` you can also use the provided `docker-compose.yml` file to start the database containers. Each one has a service named after the Spring profile: ```bash -docker-compose --profile mysql up +docker compose up mysql ``` or ```bash -docker-compose --profile postgres up +docker compose up postgres ``` ## Test Applications diff --git a/docker-compose.yml b/docker-compose.yml index 8fdaacbc6f0..47579bbaf59 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -11,8 +11,6 @@ services: - MYSQL_DATABASE=petclinic volumes: - "./conf.d:/etc/mysql/conf.d:ro" - profiles: - - mysql postgres: image: postgres:17.0 ports: @@ -21,5 +19,3 @@ services: - POSTGRES_PASSWORD=petclinic - POSTGRES_USER=petclinic - POSTGRES_DB=petclinic - profiles: - - postgres diff --git a/src/test/java/org/springframework/samples/petclinic/PostgresIntegrationTests.java b/src/test/java/org/springframework/samples/petclinic/PostgresIntegrationTests.java index 519081320fc..0b9e4f93a7c 100644 --- a/src/test/java/org/springframework/samples/petclinic/PostgresIntegrationTests.java +++ b/src/test/java/org/springframework/samples/petclinic/PostgresIntegrationTests.java @@ -49,7 +49,7 @@ import org.testcontainers.DockerClientFactory; @SpringBootTest(webEnvironment = WebEnvironment.RANDOM_PORT, properties = { "spring.docker.compose.skip.in-tests=false", // - "spring.docker.compose.profiles.active=postgres" }) + "spring.docker.compose.start.arguments=--force-recreate,--renew-anon-volumes,postgres" }) @ActiveProfiles("postgres") @DisabledInNativeImage public class PostgresIntegrationTests { @@ -72,7 +72,7 @@ public static void main(String[] args) { new SpringApplicationBuilder(PetClinicApplication.class) // .profiles("postgres") // .properties( // - "spring.docker.compose.profiles.active=postgres" // + "spring.docker.compose.start.arguments=postgres" // ) // .listeners(new PropertiesLogger()) // .run(args);