How to Deploy a Node.js App with Redis on Render

0
1
Asked By CuriousTraveler42 On

I'm trying to deploy my Node.js application, which is just one index.js file, on Render, but I can't figure out how to get my Redis server to run. Currently, I need to start the Redis server through the terminal for my application to work locally. I'm not very experienced with Docker, and I've tried following some advice from AI to create a docker-compose.yml and Dockerfile, but I'm still having trouble getting it to work. If anyone has done this before or has any tips on setting up Redis for deployment, please help! Here's a link to my project on GitHub for reference: https://github.com/GauravKarakoti/SocialSwap.

2 Answers

Answered By CodeWizard88 On

You definitely need a docker-compose setup with both your main app and the Redis server. The logs suggest that your application can't find the Redis server address, so check the settings in your docker-compose.yml. Instead of using a generic name for the Redis service, make sure you're pointing it correctly in your app to the Redis container's name. If it’s trying to connect to 'redis', ensure that's the name you've given to the Redis service in docker-compose.

Answered By TechNinja99 On

You might want to check out the Redis setup documentation in your repo. It should give you some guidance. If you're having issues, make sure to share what exactly you've tried and what errors you're getting. For instance, I noticed others running into problems with using a custom Redis image. Just use the official Redis image in your docker-compose file, and the server address should be set to :6379. That should help with the errors you're facing!

Related Questions

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.