Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/hatamiarash7/mongo-with-auth
Setup authentication on Official MongoDB image
https://github.com/hatamiarash7/mongo-with-auth
database docker docker-image mongo mongodb
Last synced: 19 days ago
JSON representation
Setup authentication on Official MongoDB image
- Host: GitHub
- URL: https://github.com/hatamiarash7/mongo-with-auth
- Owner: hatamiarash7
- License: gpl-3.0
- Created: 2020-09-02T15:38:41.000Z (about 4 years ago)
- Default Branch: master
- Last Pushed: 2023-12-15T17:56:13.000Z (11 months ago)
- Last Synced: 2024-10-09T18:01:53.868Z (about 1 month ago)
- Topics: database, docker, docker-image, mongo, mongodb
- Language: Shell
- Homepage:
- Size: 26.4 KB
- Stars: 0
- Watchers: 2
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# MongoDB with authentication
[![GitHub license](https://img.shields.io/github/license/hatamiarash7/Mongo-With-Auth)](https://github.com/hatamiarash7/Mongo-With-Auth/blob/master/LICENSE) ![Github](https://github.com/hatamiarash7/Mongo-With-Auth/workflows/Github/badge.svg) ![Dockerhub](https://github.com/hatamiarash7/Mongo-With-Auth/workflows/Dockerhub/badge.svg) ![Docker Image Size (latest by date)](https://img.shields.io/docker/image-size/hatamiarash7/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.
It's an updated version of [docker-mongo-auth](https://github.com/aashreys/docker-mongo-auth). That's not maintain anymore.
## Customization
There are multiple environment variables which you can specify to customize the username and passwords of your users.
- With Dockerfile
```dockerfile
# ENV AUTH yes# ENV MONGODB_ADMIN_USER admin
# ENV MONGODB_ADMIN_PASS adminpass# ENV MONGODB_APPLICATION_DATABASE testdatabase
# ENV MONGODB_APPLICATION_USER testuser
# ENV MONGODB_APPLICATION_PASS testpass
```
- With docker-compose.yml```yaml
services:
db:
image: hatamiarash7/mongo-auth:latest
environment:
- AUTH=yes
- MONGODB_ADMIN_USER=admin
- MONGODB_ADMIN_PASS=adminpass
- MONGODB_APPLICATION_DATABASE=testdatabase
- MONGODB_APPLICATION_USER=testuser
- MONGODB_APPLICATION_PASS=testpass
```- With command line
```bash
docker run -it \
-e AUTH=yes \
-e MONGODB_ADMIN_USER=admin \
-e MONGODB_ADMIN_PASS=adminpass \
-e MONGODB_APPLICATION_DATABASE=testdatabase \
-e MONGODB_APPLICATION_USER=testuser \
-e MONGODB_APPLICATION_PASS=testpass \
-p 27017:27017 hatamiarash7/mongo-auth:latest
```## Support
[![ko-fi](https://www.ko-fi.com/img/githubbutton_sm.svg)](https://ko-fi.com/D1D1WGU9)
## Contributing
1. Fork it !
2. Create your feature branch : `git checkout -b my-new-feature`
3. Commit your changes : `git commit -am 'Add some feature'`
4. Push to the branch : `git push origin my-new-feature`
5. Submit a pull request :D## Issues
Each project may have many problems. Contributing to the better development of this project by reporting them.