strapi / strapi-docker

Install and run your first Strapi project using Docker
https://strapi.io
MIT License
1.16k stars 447 forks source link

Support MongoDB Atlas URI #264

Open saurabhperiwal opened 3 years ago

saurabhperiwal commented 3 years ago

I am trying to connect strapi docker image to MongoDB atlas, but everytime I try connecting it throws error "Could not connect."

wrzlbrmft commented 3 years ago

Been there just yesterday. Check this: https://strapi.io/documentation/v3.x/guides/databases.html#install-on-atlas-mongodb-atlas

ronny35 commented 3 years ago

Hello,

Could you consider the possibility to generate a new database config (MongoDB) with uri information in order to take into account replicaSet, SSL, ... during first install ?

module.exports = ({ env }) => ({
  defaultConnection: 'default',
  connections: {
    default: {
      connector: 'mongoose',
      settings: {
        uri: "mongodb://<USERNAME>:<PASSWORD>@<HOST>:<PORT>/<DATABASE>?ssl=<SSL>&replicaSet=<REPLICASET>"
      },
      options: {
      },
    },
  },
});

Thanks in advance for your help.