Skip to content

Commit

Permalink
Infra - removed need for host to have mongo client utils
Browse files Browse the repository at this point in the history
  • Loading branch information
GregJohnStewart committed Mar 14, 2023
1 parent bd2e2d4 commit c925b2f
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 7 deletions.
10 changes: 6 additions & 4 deletions software/Infrastructure/.idea/workspace.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
#
# TODO:: figure out better username/password situation
# - https://lzone.de/blog/Using-Linux-keyring-secrets-from-your-scripts
#
# TODO:: rework for docker compose?
# - do init in dontainer, to avoid mongo tools requirement: https://stackoverflow.com/a/64153124/3015723

[Unit]
Description=Mongo server for Open Quartermaster. Version ${version}, using MongoDB tagged to "4".
Expand All @@ -24,7 +27,7 @@ ExecStartPre=/bin/bash -c "/usr/bin/docker rm oqm_mongo || echo 'Could not remov

ExecStart=/bin/bash -c "/usr/bin/docker run --name oqm_mongo -p=27017:27017 -v /data/oqm/db/mongo/:/data/db mongo:4 mongod --replSet rs0"
ExecStartPost=/bin/bash -c "sleep 3s"
ExecStartPost=/bin/bash -c "mongo --eval \"rs.initiate({'_id':'rs0', 'members':[{'_id':0,'host':'localhost:27017'}]})\" || echo 'Probably already initialized.'"
ExecStartPost=/bin/bash -c "/usr/bin/docker exec oqm_mongo --eval \"rs.initiate({'_id':'rs0', 'members':[{'_id':0,'host':'localhost:27017'}]})\" || echo 'Probably already initialized.'"

ExecStop=/bin/bash -c "/usr/bin/docker stop -t 10 oqm_mongo || echo 'Could not stop mongo container'"
ExecStopPost=/bin/bash -c "/usr/bin/docker rm oqm_mongo || echo 'Could not remove mongo container'"
Expand Down
4 changes: 2 additions & 2 deletions software/Infrastructure/mongo/properties.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
{
"packageName":"open+quarter+master-infra-mongodb",
"version":"1.0.4",
"version":"1.0.5",
"description":"MongoDb instance for Open QuarterMaster.",
"homepage":"https://github.com/Epic-Breakfast-Productions/OpenQuarterMaster/tree/main/software/Infrastructure/mongo",
"configs": [
"# Mongo Config:",
"quarkus.mongodb.connection-string=mongodb://host.docker.internal:27017"
],
"dependencies": {
"deb": ", mongodb-clients"
"deb": ""
},
"configFiles":{
}
Expand Down

0 comments on commit c925b2f

Please sign in to comment.