Deploy NodeJS with MongoDB

Hey there!

I’m developing an app via NodeJS and I use a MongoDB. Now, I would like to deploy my app with a database as easy as possible and I do not want to manage a server by myself.

So, I have a docker image of my NodeJS application that also serves my Vue frontend and is apparently inside the image. Beside, I want to run a MongoDB. How can I conveniently run the docker image and the MongoDB without managing a server, just deploy them. The best would be, if DO checks the GitLab container registry frequently if there is a new latest image available and pull that.

Is it somehow possible?


Submit an answer
You can type!ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Hey @Effection,

DigitalOcean has a new product offering called App Platform which best serves the purpose of deploying apps directly using the git repo and hence relieving you from the pain of managing servers. App Platform has an integration with Github and Gitlab. Using this offering you can create an app by linking your git repo in Gitlab. Any changes/commits in the configured repo would be autodetected and deployed (Provided the auto deploy is enabled).

GitLab container registry is not supported but you can leverage any of the below features to deploy your container image:

  1. We support two container registries namely Docker hub and DOCR and the pushed image can then be used in App Platform. Here’s a tutorial for your reference: Docs for Container Registry

  2. You can have a Dockerfile in the repo and every time a change is made, the app would be auto built and deployed. Here’s a documentation for your reference: Docs for deployment using Dockerfile

App Platform Documentation:

As far as the integration with MongoDB is concerned, we do not support it currently but we will soon have it in a couple of months. As of now, you can leverage it using MongoDB Atlas or any third party services to host the database. The only restriction would be to ensure that you do not have any firewall or IP restriction on the same.

If you have any further questions/concerns, please comment below or feel free to reach out to our Support Team.

Cheers, Taha Fatima