From 07ce1e2460f8b3d8a4feb21c25d25fa34629b4e6 Mon Sep 17 00:00:00 2001 From: Luc Juggery Date: Sun, 15 Oct 2023 14:49:56 +0200 Subject: [PATCH] Add missing exposed port --- Acornfile | 1 + README.md | 20 +++++++++++++++++++- scripts/render.sh | 1 + 3 files changed, 21 insertions(+), 1 deletion(-) diff --git a/Acornfile b/Acornfile index 2521ead..4988755 100644 --- a/Acornfile +++ b/Acornfile @@ -25,6 +25,7 @@ containers: { name: "MongoDB" description: "Container running a MongoDB server" image: "mongo:6.0" + ports: "27017/tcp" env: { MONGO_INITDB_ROOT_USERNAME: "root" MONGO_INITDB_ROOT_PASSWORD: "secret://rootpassword/token" diff --git a/README.md b/README.md index ec911c0..a30ddbc 100644 --- a/README.md +++ b/README.md @@ -21,4 +21,22 @@ For instance, using this endpoint we can send an HTTP Get request using cURL: ``` $ curl k8s-test3e3d-apppubli-58f1d9adf4-5081003c9ca93235.elb.us-east-2.amazonaws.com:8000 {"message":"Webpage viewed 1 time(s)"} -``` \ No newline at end of file +``` + +## Parameters + +When the single *MongoDB* instance is created, a default user is created, this one only has admin access against a given database. By default: +- *dbUser* is automatically generated +- *dbName* is set to "mydb" + +These values can be changed using the *serviceArgs* property as follow: + +``` +services: db: { + image: "ghcr.io/lucj/acorn-postgres:v#.#.#" + serviceArgs: { + dbUser: "bar" + dbName: "foo" + } +} +``` diff --git a/scripts/render.sh b/scripts/render.sh index 4cb77d3..265c51c 100755 --- a/scripts/render.sh +++ b/scripts/render.sh @@ -6,6 +6,7 @@ while true; do echo "[render.sh] wait for db to be ready" mongosh --quiet --host "mongodb" --username ${MONGO_INITDB_ROOT_USERNAME} --password ${MONGO_INITDB_ROOT_PASSWORD} --authenticationDatabase admin --eval "db.runCommand({ ping: 1 })" if [ $? -eq 0 ]; then + echo "[render.sh] db is ready" break fi sleep 2