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

chore(deps): update mongo docker tag to v7.0.5 #892

Merged
merged 2 commits into from
Feb 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading