Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setting up a Free MongoDB Atlas Cluster #76

Open
ericvlog opened this issue Aug 8, 2024 · 0 comments
Open

Setting up a Free MongoDB Atlas Cluster #76

ericvlog opened this issue Aug 8, 2024 · 0 comments

Comments

@ericvlog
Copy link
Owner

ericvlog commented Aug 8, 2024

Setting up a Free MongoDB Atlas Cluster

This guide will walk you through setting up a free MongoDB Atlas cluster which can be used as a database for your applications.

Step 1: Sign Up or Log In to MongoDB Atlas

Go to the MongoDB Atlas website and sign up or log in to your account.

Step 2: Create a New Project

  • After logging in, create a new project by clicking the "Create a New Project" button.
  • Give your project a name and add any members if you're working as part of a team.

Step 3: Create a Free Cluster

  • Inside your new project, click the "Create" button to create a new cluster.
  • Choose the "Free" cluster tier which provides you with 512 MB of storage.
  • Select your cloud provider and the region closest to your application users for optimal performance.
  • Click "Create" to provision your free cluster.

Step 4: Configure Database Access

  • Navigate to the "Database Access" section under the "Security" menu on the left-hand side.
  • Add a new database user with a username and a secure password. Remember these credentials as you'll use them to connect to your database.

Step 5: Configure Network Access

  • Go to the "Network Access" section under the "Security" menu.
  • Click "Add IP Address" and either add your current IP address or allow access from anywhere "0.0.0.0/0" (not recommended. Know what you're doing).

Step 6: Connect to Your Database

  • Once your cluster is provisioned, click the "Connect" button next to your cluster.
  • In case if you're not setting up IP Whitelist and DB User, you can see the below screen.
  • Select the "Drivers"
  • Choose Python as your driver.
  • Copy the provided connection string and replace <password> with the password of the database user you created.

Replace the MONGO_URI in the .env file with the connection string you copied from the previous step.

Make sure to add the Database name in the connection string. Example Database name is mediafusion.

MONGO_URI=mongodb+srv://<username>:<password>@<cluster-url>/<database-name>?retryWrites=true&w=majority

Remove the mongodb container and depends_on from the docker-compose.yml file.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant