Best Practice for running multiple apps using docker on VPS - docker

I want to run multiple full-stack apps(MEAN) on single VPS using docker for multiple domains with SSL.
I have researched a lot but couldn't find any elegant solution.
What I have tried
I followed this tutorial: https://egghead.io/lessons/node-js-setup-an-nginx-proxy-for-a-node-js-app-with-docker, but it is for running only one app(node.js) using Nginx proxy.
Required Features
CD/CI using git
Easy server migration
I'm a newbie in the docker world.
Looking for Help!!
Thanks

Related

Setting up a Docker-Compose that will set up a Rails dev enviroment for local development

I’m new to Docker, I think I’m getting it down for server setup using docker, however I want to use Docker so non-engineer staff in my company can more easily setup a Rails dev enviroment, database, installing libraries on the ruby and javascript end, that kind of thing.
I can do it using Docker, however it requires getting into the docker engine and tweaking databases and what not which I feel is asking a lot for a non-engineer persons and doesn’t lessen there burden as just setting them up natively.
I’ve looked around on guides to setup Rails environments but they all tend to have a lot of work required to get everything up and running, I wish to have a more easier way of just fire up terminal and go to the project folder, smack 1 or 2 commands in and have it all done, is there any guide or example setup to do something like this?

What's Docker easiest way to deploy Rails on production?

I'm interested in Docker as it creates a neat way of setting up an application environment.
EDIT : I'm on Digital Ocean Droplet created with their Docker 1 click Application.
Apparently there isn't a proper way to deploy a Rails application to production, or at least I haven't found it. The setup seems much more complicated then setting up the server from scratch and using Capistrano. I tried using Heroku but it doesn't entirely support Docker.
Is there any good guideline on how to setup Docker to deploy a simple Rails application on a production server?
I read/watched already this references:
The Quickstart: Docker Compose and Rails is ok for development, but then Using Compose in production is too rough and superficial.
The Docker for DevOps course: From development to pro
way too complex, but is the only that at the end tells you how to deploy Rails on Digital Ocean. Anyway there must be an easier way.
Deploying Your Docker Rails App
is just for Heroku.
Getting to know Centurion
does anyone use Centurion to deploy?
Docker + Capistrano = Warp Speed
a bit buggy and outdated.
Running multiple web applications on a Docker host with Apache
the right approach, shame is not for Rails..

Use Docker rather than native/homebrew on Mac?

I currently have a LAMP stack installed on my mac running through Homebrew, which, to be honest hardly ever get's used.
Lately I have been working a lot with AngularJS and service based apps, so generally run the sites through a gulp / nodeJS based webserver.
I am totally frontend orientated, so very rarely do I play with backend related technologies other than the odd Drupal site and mysql.
I am interested to learn more NodeJS, perhaps even some Ruby, purely to understand programming more - not really for it to become my new job description.
So reading up on NodeJS a bit last night I read a lot about Docker, and installed it the toolkit and gui this morning. It looks pretty neat!
My question is: Would it work better for me to just run everything I need through Docker? For example, I can just install the mysql container, and turn it on when I need a db, and just spin up a drupal instance when I need one and connect it to my db instance?
I understand that running Docker on Mac is slower as it doesn't have the native Linux kernel and runs through a VM - but considering my needs from it, this should be okay?
I love the idea of just deploying containers, so will probably want to install Docker on my hosting environment too (VM in the cloud).
Follow up question: 90% of the sites I work on are AngularJS based frontends that speak to APIs that our backend guys build separately. Would it be overkill to have a Docker for each of those sites, or would I rather just run them all in one, or just bypass docker entirely for that (as I mentioned, I normally just load them up from within my Gulp's webserver)
Thanks a lot. I realise this is a n00b asking questions about big technology, but I'm trying to wrap my head around it and hopefully grow a bit in the process.
The interest in deploying Docker container is reproducibility.
You can easily reproduce:
either a complex development environment requiring the installation of numerous libraries (that you don't want to pollute directly your host)
or an execution environment, for a given tool to run (like a web server)
If you are not likely to repeat a setup (for dev or exec), a docker container would bring little value.
But if you want to keep track of the exact specification of an environment (through its Dockerfile) and will deploy it not just on your workstation, but in other places as well, then docker is certainly a good option to consider.

Micro Cloud Foundry microconsole startup

So ive been looking through the init.d scripts and the bashrc file and cannot find where the microconsole binary is started on initial login. Can anyone tell me where it is?
Also, does MCF support running two microconsole instances at a time? My IaaS provider only supports SSH.
I am not entirely sure what you are trying to achieve here. Your trying to host MCF with an IaaS provider? like EC2 for example? If this is the case, I would recommend installing VCAP, MCF is not kept as up to date as the VCAP project.
It's pretty straight forward to install on Ubuntu 10.04, there are instructions on the Github project page, here ... https://github.com/cloudfoundry/vcap

How to configure and deploy Ruby on Rails Application on server using apache, heroku or Phusion Passenger dont know about such terms

I am new to Ruby on Rails. I have been working as junior developer and most of time working on localhost so don't know how to launch Ruby on rails application, How to Configure Ruby on rails application and how to deploy it.
often I came accross following terms but don't know It's meaning and how to use them and where to use them.
Apache
Phusion Passenger
Heroku
nginx
Please Help me and also looking forward to any good tutorial to learn all that terms.
Thanks.
I think there is quite a lot of resources on the web for this, but :
Heroku is a platform as a service. Basically, you push your rails app to a git remote, and that's it, deployed. You can manage addons, workers, and processes from CLI, and scale up/down if you need. Probably the most painless way to start with.
Apache & nginx are two werbservers, I'd say they are the most common in the rails world. Nginx is the latest of the two and it seems to be better for most of the tasks, but if you want to know which to choose, there is several posts on the internet for that too.
Phusion passenger is the bridge (or one of the available bridges) between your rails app and your webserver. If you've done php before, think of it as mod_php.
Since this is all new to you I'd advise that you start with hosting on Heroku. You can do a lot with the free version and it's arguably the easiest way to get started with hosting your rails website. Check out the getting started guide from Heroku. There's also another beginners guide here.
Once you feel comfortable with Heroku your next step could be looking into hosting on your own virtual private server (VPS). The setup is much more manual but things that would cost extra money on Heroku are now free if you set it up yourself on your VPS. Here is a great article on VPS hosting.
For reference, I was hosting websites on Heroku for about a year before I started looking into hosting on my own VPS. Now what I do is start by hosting my projects on Heroku since it's the fastest way to get up and running. Then if the website is successful I transition to a VPS.

Resources