Public Repository

Last pushed: 3 months ago
Short Description
MongoDB with support for authentication & replication (one primary, one secondary, one arbiter)
Full Description

For deployment without replication:

docker pull pawats/csi_mongo:1.2

docker run -itd \
-v /mgdbdata/mongodata_dev:/data/db \
-e MONGODB_ADMIN_USER=admin \
-e MONGODB_ADMIN_PASS=adminpass \
-e MONGODB_APPLICATION_DATABASE=mytestdatabase \
-e MONGODB_APPLICATION_USER=testuser \
-e MONGODB_APPLICATION_PASS=testpass \
-e MASTER=yes \
-p 27017:27017 -p 28017:28017 \
pawats/csi_mongo:1.2

For deployment with replication:

Run on arbiter:
docker pull pawats/csi_mongo:1.2
docker run -itd \
-v /data/mongodata_arb:/data/arb \
-e MONGODB_ADMIN_USER=admin \
-e MONGODB_ADMIN_PASS=adminpass \
-e MONGODB_APPLICATION_DATABASE=mytestdatabase \
-e MONGODB_APPLICATION_USER=testuser \
-e MONGODB_APPLICATION_PASS=testpass \
-e REPLICA_SET=rs0 \
-e ARBITER=yes \
-p 27017:27017 -p 28017:28017 \
pawats/csi_mongo:1.2

Run on secondary:
docker pull pawats/csi_mongo:1.2
docker run -itd \
-v /mgdbdata/mongodata_dr:/data/db \
-e MONGODB_ADMIN_USER=admin \
-e MONGODB_ADMIN_PASS=adminpass \
-e MONGODB_APPLICATION_DATABASE=mytestdatabase \
-e MONGODB_APPLICATION_USER=testuser \
-e MONGODB_APPLICATION_PASS=testpass \
-e REPLICA_SET=rs0 \
-p 27017:27017 -p 28017:28017 \
pawats/csi_mongo:1.2

Run on primary:
docker pull pawats/csi_mongo:1.2
docker run -itd \
-v /mgdbdata/mongodata_prod:/data/db \
-e MONGODB_ADMIN_USER=admin \
-e MONGODB_ADMIN_PASS=adminpass \
-e MONGODB_APPLICATION_DATABASE=mytestdatabase \
-e MONGODB_APPLICATION_USER=testuser \
-e MONGODB_APPLICATION_PASS=testpass \
-e REPLICA_SET=rs0 \
-e PRIMARY=yes \
-e PRIMARY_HOST=<my_primary_host:port> \
-e SECONDARY_HOST=<my_secondary_host:port> \
-e ARBITER_HOST=<my_arbiter_host:port> \
-p 27017:27017 -p 28017:28017 \
pawats/csi_mongo:1.2

Docker Pull Command
Owner
pawats

Comments (0)