Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/aashreys/docker-mongo-auth
Easily setup authentication on Docker's Official MongoDB image.
https://github.com/aashreys/docker-mongo-auth
docker-image dockerfile mongo mongodb
Last synced: 27 days ago
JSON representation
Easily setup authentication on Docker's Official MongoDB image.
- Host: GitHub
- URL: https://github.com/aashreys/docker-mongo-auth
- Owner: aashreys
- License: mit
- Created: 2017-07-04T21:51:14.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2022-12-08T13:32:09.000Z (almost 2 years ago)
- Last Synced: 2024-09-27T17:22:41.678Z (about 1 month ago)
- Topics: docker-image, dockerfile, mongo, mongodb
- Language: Shell
- Homepage:
- Size: 5.86 KB
- Stars: 83
- Watchers: 6
- Forks: 61
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Deprecated
This repository is not maintained anymore.# docker-mongo-auth
A Docker Image for MongoDB which makes it easy to create an Admin, a Database and a Database User when the container is first launched.# Customization
There are a number of environment variables which you can specify to customize the username and passwords of your users.- With Dockerfile
```
// Auth Configuration.
// These environment variables can also be specified through command line or docker-compose configuration
# ENV AUTH yes# ENV MONGODB_ADMIN_USER root
# ENV MONGODB_ADMIN_PASS password# ENV MONGODB_APPLICATION_DATABASE your_db
# ENV MONGODB_APPLICATION_USER user
# ENV MONGODB_APPLICATION_PASS password
```
- With docker-compose.yml
```
services:
db:
image: aashreys/mongo-auth:latest
environment:
- AUTH=yes
- MONGODB_ADMIN_USER=admin
- MONGODB_ADMIN_PASS=admin123
- MONGODB_APPLICATION_DATABASE=sample
- MONGODB_APPLICATION_USER=aashrey
- MONGODB_APPLICATION_PASS=admin123
ports:
- "27017:27017"
// more configuration
```- With command line
```
docker run -it \
-e AUTH=yes \
-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 \
-p 27017:27017 aashreys/mongo-auth:latest
```Find the image on Docker Cloud @ https://cloud.docker.com/swarm/aashreys/repository/docker/aashreys/mongo-auth