diff --git a/docker-compose.yml b/docker-compose.yml index e7a14d48..169b5a5c 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -75,20 +75,24 @@ services: - .:/code mongo: - image: bitnami/mongodb:6.0.4 + image: mongo:6.0.4 container_name: mongo ports: - "27018:27017" volumes: - nmdc_runtime_mongo_data:/data/db - ./tests:/app_tests + secrets: + - mongoKeyFile restart: unless-stopped + command: ["--replSet", "dbrs", "--bind_ip_all", "--keyFile", "/run/secrets/mongoKeyFile"] + healthcheck: + test: test $$(echo "rs.initiate({_id:'dbrs',members:[{_id:0,host:\"mongo\"}]}).ok || rs.status().ok" | mongo --quiet) -eq 1 + interval: 10s + start_period: 30s environment: - MONGODB_ROOT_USER: admin - MONGODB_ROOT_PASSWORD: root - MONGODB_REPLICA_SET_MODE: primary - MONGODB_ADVERTISED_HOSTNAME: mongodb-primary - MONGODB_REPLICA_SET_KEY: replicasetkey123 + MONGO_INITDB_ROOT_USERNAME: admin + MONGO_INITDB_ROOT_PASSWORD: root terminus: image: terminusdb/terminusdb-server:v11.0.6 @@ -111,4 +115,8 @@ volumes: nmdc_runtime_mongo_data: driver: local nmdc_runtime_terminus_data: - driver: local \ No newline at end of file + driver: local + +secrets: + mongoKeyFile: + file: ./mongoKeyFile \ No newline at end of file diff --git a/mongoKeyFile b/mongoKeyFile new file mode 100644 index 00000000..f6803543 --- /dev/null +++ b/mongoKeyFile @@ -0,0 +1 @@ +mysecretkey