Skip to content
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
7 changes: 7 additions & 0 deletions recipes/mongodb.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
title: "Mongodb"

actions:
- merge: database/mongodb.yml
dst: docker-compose.yml
- merge: scripts/mongodb.yml
dst: kool.yml
3 changes: 3 additions & 0 deletions recipes/pick-db.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,7 @@ actions:
- name: 'PostgreSQL 13.0'
actions:
- recipe: postgresql-13
- name: 'Mongodb'
actions:
- recipe: mongodb
- name: 'None - do not use a database'
17 changes: 17 additions & 0 deletions templates/database/mongodb.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
services:
mongodb:
image: mongodb/mongodb-community-server:latest
ports:
- "${KOOL_DATABASE_PORT:-27017}:27017"
environment:
MONGODB_INITDB_ROOT_USERNAME: "${DB_USERNAME-root}"
MONGODB_INITDB_ROOT_PASSWORD: "${DB_PASSWORD-root}"
MONGO_INITDB_DATABASE: "${DB_DATABASE-database}"
healthcheck:
test: ["CMD", "mongo", "--eval", "db.adminCommand('ping')"]

volumes:
- database:/data/db:delegated
networks:
- kool_local
- kool_global
3 changes: 3 additions & 0 deletions templates/scripts/mongodb.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
scripts:
# CLI access to MongoDB
mongodb: kool exec database mongosh --port=27017 --username=root --password=root
Loading