I was looking for some advice. It takes me a long time to deploy a django project, I have to setup the server, install libraries, configure NGINX and get all the django internals working.
I was looking into Docker or Puppet as quick was to create a cookie cutter for Django so I can deploy quickly but I've not used them much and am not entirely sure it's the best approach.
If you needed to deploy an empty, running django app frequently, how would you do it?
Thanks
CodePudding user response:
I run all my VMs on my own hardware so I use Vagrant, It's also good for settings up Production-like Dev environments.
There's probably better ways but I did it all using Shell Scripts and I have two Versions
- Base Box
- Production
In the Base Base, I made a shell script to install/get compile the big generic requirements (Nginx, Redis, SSH Keys, etc)
Then I package the Base Box and use it as the starting point for my Production, this also reduces the provisioning time and limits the risk of pre-req links breaking.
Production has it's own shell script that just installs project specific files (Pulling from Git, pip installing, setting static IPs, moving SSL certs, etc)
So to get a Server up and running all I've got to do is have the HyperVisor, Vagrant, Base Box and then do: vagrant up --provision
and boom good to go.
and because I'm running on my own machines I also have start-up scripts that automatically run that command in case the PC restarts for some reason