And make sure to change the mongo environment variable when connecting your nodejs app with the database. The database in the connection string represent the service name of your database in the docker-compose.yml.
thank you my dude. much love on this one. last question though, lets say the database is mysql? is it the same setup as nosql? and the folder for db is level with client and server? thanks man. appreciate the help.
what if I wanted to add a database? how would I dockerize that? sorry. im noob. but thank you for this though. really helps. :)
docker-compose will look like this with database. Here i am using mongo.
And make sure to change the mongo environment variable when connecting your nodejs app with the database. The
database
in the connection string represent the service name of your database in the docker-compose.yml.I hope this helps you.
thank you my dude. much love on this one. last question though, lets say the database is mysql? is it the same setup as nosql? and the folder for db is level with client and server? thanks man. appreciate the help.
I dont know know much about SQL. You can go to the dockerhub and search for mySql image. You can read more there.