Skip to content

Commit 0c910ca

Browse files
committed
Update Orion and MongoDB
1 parent c8a9ec2 commit 0c910ca

File tree

3 files changed

+12
-11
lines changed

3 files changed

+12
-11
lines changed

.env

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@ COMPOSE_PROJECT_NAME=fiware
33

44
# Orion variables
55
ORION_PORT=1026
6-
ORION_VERSION=3.10.1
6+
ORION_VERSION=3.11.0
77

88
# MongoDB variables
99
MONGO_DB_PORT=27017
10-
MONGO_DB_VERSION=4.4
10+
MONGO_DB_VERSION=6.0
1111

1212
# Tutorial variables
1313
TUTORIAL_APP_PORT=3000

docker-compose.yml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@
1818
#
1919
version: "3.8"
2020
services:
21-
# Orion is the context broker
22-
orion:
21+
# Orion is an NGSI-v2 context broker
22+
orion-v2:
2323
labels:
2424
org.fiware: 'tutorial'
2525
image: quay.io/fiware/orion:${ORION_VERSION}
@@ -44,7 +44,7 @@ services:
4444
hostname: tutorial
4545
container_name: fiware-tutorial
4646
depends_on:
47-
- orion
47+
- orion-v2
4848
networks:
4949
default:
5050
aliases:
@@ -87,10 +87,11 @@ services:
8787
volumes:
8888
- mongo-db:/data
8989
healthcheck:
90-
test: |
91-
host=`hostname --ip-address || echo '127.0.0.1'`;
92-
mongo --quiet $host/test --eval 'quit(db.runCommand({ ping: 1 }).ok ? 0 : 2)' && echo 0 || echo 1
90+
test: ["CMD","mongosh", "--eval", "db.adminCommand('ping')"]
9391
interval: 5s
92+
timeout: 5s
93+
retries: 3
94+
start_period: 5s
9495

9596

9697
networks:

services

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,17 +53,17 @@ stoppingContainers () {
5353
}
5454

5555
addDatabaseIndex () {
56-
printf "Create \033[1mMongoDB\033[0m database indexes ..."
57-
docker exec db-mongo mongo --eval '
56+
printf "Adding appropriate \033[1mMongoDB\033[0m indexes for \033[1;34mOrion\033[0m ..."
57+
docker exec db-mongo mongosh --eval '
5858
conn = new Mongo();db.createCollection("orion");
5959
db = conn.getDB("orion");
6060
db.createCollection("entities");
6161
db.entities.createIndex({"_id.servicePath": 1, "_id.id": 1, "_id.type": 1}, {unique: true});
6262
db.entities.createIndex({"_id.type": 1});
6363
db.entities.createIndex({"_id.id": 1});' > /dev/null
64-
echo -e " \033[1;32mdone\033[0m"
6564
}
6665

66+
6767
waitForMongo () {
6868
echo -e "\n⏳ Waiting for \033[1mMongoDB\033[0m to be available\n"
6969
while ! [ `docker inspect --format='{{.State.Health.Status}}' db-mongo` == "healthy" ]

0 commit comments

Comments
 (0)