Skip to content

Commit

Permalink
fix: improve mongo service deploy in docker.
Browse files Browse the repository at this point in the history
  • Loading branch information
mo3et committed Oct 31, 2024
1 parent 269dd71 commit 5dbd7b0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ services:
ports:
- "37017:27017"
container_name: mongo
command: ["/bin/bash", "-c", "/docker-entrypoint-initdb.d/mongo-init.sh; docker-entrypoint.sh mongod --wiredTigerCacheSizeGB 1 --auth"]
command: ["/bin/bash", "-c", "docker-entrypoint.sh mongod --wiredTigerCacheSizeGB 1 --auth & /docker-entrypoint-initdb.d/mongo-init.sh; wait"]
volumes:
- "${DATA_DIR}/components/mongodb/data/db:/data/db"
- "${DATA_DIR}/components/mongodb/data/logs:/data/logs"
Expand Down
6 changes: 3 additions & 3 deletions scripts/mongo-init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
echo "before running mongosh..."

mongosh <<EOF
var maxRetries = 300;
var connected = false;
Expand Down Expand Up @@ -61,6 +63,4 @@ if (connected) {
}
EOF




echo "mongosh completed..."

0 comments on commit 5dbd7b0

Please sign in to comment.