Skip to content

Automated CI/CD of MongoDB with docker-compose.yml and .github/workflows for GitHub Actions.

Notifications You must be signed in to change notification settings

derecksprojects/derecks-mongodb

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

dereck-mongodb

Automated CI/CD of MongoDB with docker-compose.yml and .github/workflows for GitHub Actions.

security

remote access

Whitelist IPs so we can connect to the database from our local machine.

sudo ufw enable
sudo ufw allow from <IP-ADDRESS> to any port 27017

root account and auth

I set up a default root account and required authentication to access the database.

Note that when you pass a password you need to escape certain characters such as $ becomes %24.

# connect from inside the linode
mongosh mongodb://root:password@localhost:27017/
# connect from local use connection string in compass
mongodb://admin:[email protected]:27017/

server

persistent data across deleted containers/restarts

I named the volume dereck-mongo-data.

docker volume ls
docker volume inspect dereck-mongo-data
# delete volume
docker volume rm dereck-mongo-data