Code Monkey home page Code Monkey logo

mongodumper's Introduction

mongodumper

Docker image to back up MongoDB database and upload to S3

Usage

To run the image locally, first build it

docker build -t mongodumper .

Then run it with the following environment variables:

docker run -e MONGO_URI="mongo://localhost:27017/some-db" \
    -e S3BUCKET_PATH="bucket_name/path" \
    -e AWS_ACCESS_KEY_ID="XXX" \
    -e AWS_SECRET_ACCESS_KEY="XXX" \
    -e AWS_DEFAULT_REGION="ap-south-1"  \
    mongodumper

Publishing

To build and publish the image to ECR, use the following commands

ECR_REPO="repo-name" ECR_REGION="region" ./ecr-publish.sh

You can optionally pass the tag as the first argument to the script, otherwise it will use the latest tag

ECR_REPO="repo-name" ECR_REGION="region" ./ecr-publish.sh 1.0.0

.ecr-publish.sh builds the image and uses the aws cli to publish the image to ECR. Make sure you have the aws cli installed and configured with the correct credentials. You can also use the AWS_PROFILE environment variable to specify the profile to use.

License

MIT © Kamran Ahmed

mongodumper's People

Contributors

kamranahmedse avatar

Stargazers

Steven avatar Joseph Gan avatar Nidal Ade avatar Vineet  avatar  avatar  avatar David Adarme avatar David Wahyu Pratomo avatar Khaled Sameer avatar Syed Bakibillah Sakib avatar Rexford Essilfie avatar Zeeshan Ahmad avatar Arkadius Jonczek avatar Mahmoud Kinawy avatar dgo2dance avatar Muh. Sukrillah avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.