add MonfoDB and Mongo-Express to pod

This commit is contained in:
2026-02-02 00:25:31 +01:00
parent 6944b3a209
commit 662bc75b0d
+39
View File
@@ -27,6 +27,8 @@ else
-p 8500:8500 \
-p 8600:8600 \
-p 8900:8080 \
-p 27017:27017 \
-p 8081:8081 \
-p 61616:61616 \
-p 8161:8161 \
-p 5672:5672 \
@@ -40,6 +42,13 @@ else
podman volume create kontor-db
fi
echo "==> Setting up volume kontor-mongo"
if podman volume exists kontor-mongo; then
echo " => volume kontor-mongo exists"
else
podman volume create kontor-mongo
fi
echo "==> Setting up volume activemq-data"
if podman volume exists activemq-data; then
echo " => volume kontor-db exists"
@@ -74,6 +83,35 @@ else
podman run -d --replace --pod kontor --name adminer docker.io/library/adminer
fi
echo "==> Setting up container mongodb"
if podman container exists mongodb; then
if podman ps -q --filter "name=mongodb"; then
echo " => mongodb is running"
fi
else
podman run -d --replace --pod kontor --name mongodb \
-e MONGO_INITDB_ROOT_USERNAME=kontor \
-e MONGO_INITDB_ROOT_PASSWORD=kontor \
-v kontor-mongo:/data/db \
docker.io/library/mongo:latest
fi
echo "==> Setting up container mongo-express"
if podman container exists mongo-express; then
if podman ps -q --filter "name=mongo-express"; then
echo " => mongo-express is running"
fi
else
podman run -d --replace --pod kontor --name mongo-express \
-e ME_CONFIG_MONGODB_SERVER="mongodb" \
-e ME_CONFIG_MONGODB_ADMINUSERNAME="kontor" \
-e ME_CONFIG_MONGODB_ADMINPASSWORD="kontor" \
-e ME_CONFIG_BASICAUTH_ENABLED="true" \
-e ME_CONFIG_BASICAUTH_USERNAME="kontor" \
-e ME_CONFIG_BASICAUTH_PASSWORD="kontor" \
docker.io/mongo-express:latest
fi
echo "==> Setting up container activemq"
if podman container exists activemq; then
if podman ps -q --filter "name=activemq"; then
@@ -231,3 +269,4 @@ else
--health-retries=10 \
localhost/kontor-javalin:0.3.0
fi