1

I'm using Flask as my backend and MongoDB for storing the data. I've connected my Website to MongoDB Atlas and tested everything locally and it works as expected. But when I try deploying the website to Google Cloud Platform (GCP) MongoDB doesn't work at all. The only configuration file that I have is app.yaml and it looks like this:

    runtime: python
    env: flex
    entrypoint: gunicorn -b :$PORT main:app

    runtime_config:
      python_version: 3

    handlers:
    - url: /static
      static_dir: static
    - url: /.*
     script: auto

I have connected my project to an Instance and enabled API Engine. For deployment, I simply ran the following command in Cloud Shell

    gcloud app deploy

Do I need any other configuration files to run MongoDB? Or is the whole process wrong and I need to do it in another way.

Hamad
  • 373
  • 5
  • 14
  • How do you reach your MongoDB cluster? What are the network permissions/config on your MongoDB atlas console? – guillaume blaquiere Feb 06 '20 at 05:49
  • I've set the Network connection to connect from everywhere 0.0.0.0/0 – Hamad Feb 06 '20 at 10:27
  • What do you mean by `I have connected my project to an Instance`? – guillaume blaquiere Feb 06 '20 at 13:53
  • By following https://cloud.google.com/compute/docs/instances/connecting-to-instance – Hamad Feb 07 '20 at 14:03
  • Do you mean that you see your app engine flex into the compute engine list? – guillaume blaquiere Feb 07 '20 at 21:10
  • Yes, that's what I mean – Hamad Feb 08 '20 at 09:36
  • There is a special trick to do for seeing it? AFAIK, I never view the App Engine Flex instance in the compute instance list. – guillaume blaquiere Feb 08 '20 at 19:10
  • Are you getting any error when trying to connect to Mongo, or what is the issue you are facing right now? Also, It may be worth that you check either [this](https://stackoverflow.com/questions/51946930/connect-to-mongodb-atlas-from-google-app-engine) or [this](https://cloud.google.com/community/tutorials/mongodb-atlas-appengineflex-nodejs-app) in order to get a better grasp on how to connect App Engine to MongoDB Atlas – rsalinas Feb 14 '20 at 14:45
  • You will have to pay to google. Otherwise you will have to use sql server crack and merge with M – Brad Disouza Feb 05 '20 at 10:26
  • I'm using the free trial. They give you 300$ for a year so I don't think there's a problem with that – Hamad Feb 05 '20 at 10:39

0 Answers0