Skip to content

Commit 36924bc

Browse files
author
Osvaldo Abel
committed
feat: add templates for mongodb support
1 parent 18dce5b commit 36924bc

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

templates/database/mongodb.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
services:
2+
mongodb:
3+
image: mongodb/mongodb-community-server:latest
4+
ports:
5+
- "${KOOL_DATABASE_PORT:-27017}:27017"
6+
environment:
7+
MONGODB_INITDB_ROOT_USERNAME: "${DB_USERNAME-root}"
8+
MONGODB_INITDB_ROOT_PASSWORD: "${DB_PASSWORD-root}"
9+
MONGO_INITDB_DATABASE: "${DB_DATABASE-database}"
10+
healthcheck:
11+
test: ["CMD", "mongo", "--eval", "db.adminCommand('ping')"]
12+
13+
volumes:
14+
- database:/data/db:delegated
15+
networks:
16+
- kool_local
17+
- kool_global

templates/scripts/mongodb.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
scripts:
2+
# CLI access to MongoDB
3+
mongodb: kool exec database mongosh --port=27017 --username=root --password=root

0 commit comments

Comments
 (0)