Skip to content

Commit

Permalink
chore(deps): update mongo docker tag to v7.0.5 (#892)
Browse files Browse the repository at this point in the history
* chore(deps): update mongo docker tag to v7.0.5

* changes to fix starting app

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Raja Kolli <[email protected]>
  • Loading branch information
renovate[bot] and rajadilipkolli authored Feb 19, 2024
1 parent 8283a19 commit 93c6483
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 12 deletions.
6 changes: 3 additions & 3 deletions boot-mongodb-elasticsearch/docker/docker-compose-cluster.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ services:
mongo1:
container_name: mongo1
hostname: mongo1
image: mongo:6.0.13
image: mongo:7.0.5
extra_hosts:
- "host.docker.internal:host-gateway"
- "docker.for.win.host.internal:host-gateway"
Expand All @@ -20,7 +20,7 @@ services:
mongo2:
container_name: mongo2
hostname: mongo2
image: mongo:6.0.13
image: mongo:7.0.5
extra_hosts:
- "host.docker.internal:host-gateway"
- "docker.for.win.host.internal:host-gateway"
Expand All @@ -33,7 +33,7 @@ services:
mongo3:
container_name: mongo3
hostname: mongo3
image: mongo:6.0.13
image: mongo:7.0.5
extra_hosts:
- "host.docker.internal:host-gateway"
- "docker.for.win.host.internal:host-gateway"
Expand Down
5 changes: 3 additions & 2 deletions boot-mongodb-elasticsearch/docker/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,14 @@ version: "3.9"
services:
mongodb:
hostname: mongodb
image: mongo:6.0.13
image: mongo:7.0.5
volumes:
- mongodb:/data/db
ports:
- "27017:27017"
healthcheck:
test: test $$(echo "rs.initiate().ok || rs.status().ok" | mongo --quiet) -eq 1
test: |
mongosh --eval "try { rs.status().ok } catch (e) { rs.initiate({ _id: 'rs0', members: [{ _id: 0, host: 'localhost:27017' }] }).ok }"
interval: 10s
start_period: 30s
command: ["/usr/bin/mongod", "--replSet", "rs0", "--bind_ip_all"]
Expand Down
2 changes: 1 addition & 1 deletion boot-mongodb-elasticsearch/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@
<configuration>
<java>
<googleJavaFormat>
<version>1.17.0</version>
<version>1.19.2</version>
<style>AOSP</style>
</googleJavaFormat>
</java>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ public class RestaurantController {

@GetMapping
public Mono<ResponseEntity<SearchPage<Restaurant>>> findAllRestaurants(
@Valid @RequestParam(defaultValue = "10") @Size(max = 999) Integer limit,
@RequestParam(defaultValue = "0") Integer offset) {
@Valid @RequestParam(defaultValue = "10") @Size(max = 999) int limit,
@RequestParam(defaultValue = "0") int offset) {
return restaurantService.findAllRestaurants(offset, limit).map(ResponseEntity::ok);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ private List<ChangeStreamResume> getResumeToken() {
return this.changeStreamResumeRepository.findAll().toStream().toList();
}

public Mono<SearchPage<Restaurant>> findAllRestaurants(Integer offset, Integer limit) {
public Mono<SearchPage<Restaurant>> findAllRestaurants(int offset, int limit) {
Sort sort = Sort.by(Sort.Direction.DESC, "restaurant_id");
Pageable pageable = PageRequest.of(offset, limit, sort);
return this.restaurantESRepository.findAll(pageable);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@ ElasticsearchContainer elasticsearchContainer() {
@Bean
@RestartScope
MongoDBContainer mongoDBContainer() {
return new MongoDBContainer(DockerImageName.parse("mongo").withTag("6.0.12"))
.withSharding();
return new MongoDBContainer(DockerImageName.parse("mongo").withTag("7.0.5")).withSharding();
}

public static void main(String[] args) {
Expand Down
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ services:
- /var/run/docker.sock:/var/run/docker.sock

mongodb:
image: mongo:7.0.2
image: mongo:7.0.5
ports:
- "27017:27017"
volumes:
Expand Down

0 comments on commit 93c6483

Please sign in to comment.