By alifar
Hi there,
What would be the best scenario for having a MEAN stack web application running on a droplet with sub domains using docker container(s)?
For example: domain.com (landingspage) (nginx) api.domain.com (backend API) (node) app.domain.com (frontend client side) (nginx)
Ideally would be that each sub domain has it’s own container so that we can keep the SoC in mind.
After doing some research we see that there is a way doing this with a nginx reserve proxy as explained here: https://www.digitalocean.com/community/questions/how-to-host-multiple-docker-containers-on-a-single-droplet-with-nginx-reverse-proxy
Would this be the ideal situation when we having separate repo’s and having an SSL wildcard for the subdomains?
Any help or guidance would be very appreciated :)
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Hi there @alifar,
Yes following the steps from that link that you’ve shared would definitely work.
Another approach that you could take is to run your Nginx server in a Docker container as well, that way you would not have to install Nginx on the host itself.
Another thing that you might want to consider is to build a docker-compose file and start all of your containers with one run rather than manually start the containers one by one with the docker run command.
Regards, Bobby
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.