4 ms·
>Deployment should not be part of, or in any way linked to, code. Why?
by koboll 7y ago
>Deployment should not be part of, or in any way linked to, code.
Why?
- Ohn0 7y agoProbably because deployment is environment specific? So I guess that would be ok for your own project, but not something intended to be shared, where you don't know the target deployment environment.
- dvt 7y agoBecause deployment tends to be very context-sensitive[1], but code should almost never be. [1] Are you running this in the cloud? On Google? On AWS? Cloud functions? A containerized VM? Maybe you're running it on an old Mac in your basement. If you're deploying on Linux, you're using lots of bash scripts but -- whoopsie -- those won't work on Windows.
- originalvichy 7y agoThis is why Docker is suggested. It is the best thing so far even though a more polished system can/should take its place. A well written Dockerfile and docker-compose files contain and describe all the dependencies you need and you can copy them to an Ansible playbook or just a script for your choice of OS/environment.
- slig 7y ago... and that's exactly why Docker shines so much.
- avip 7y ago[1] You've basically listed the very reason I'm using docker. It makes my code deployment agnostic. Bash "setup" files? been there. I write Dockerfiles. I think that's the only thing I'm strongly opinionated about as a developer. --- EDIT This is a classic. Reading the backend "how to run" guide I see: DATABASE=<your-mongodb-connection-string> PORT=5000 SERVER_URL=http://localhost:5000 This should settle any debate about docker being "overkill". Developers are notoriously reluctant to install things on their dev machines. As-is this repo has non-trivial setup friction which will reduce # of potential users/testers. TL;DR: docker-compose up
- dvt 7y agoLike I mentioned, I have laptops that can't even run Docker. I've had to fix CMOS/BIOS settings to be able to run Docker on my main dev box. Also, running Docker can sometimes mean not being able to run VMWare (due to virtualization settings). Not to mention that version controlling Docker repos is a huge pain in the butt, we've had to call our dev ops guy in the middle of the night because some random dependency changed some version that broke something down the line. Pretending that using Docker is as easy as "docker-compose up" is either disingenuous, or you simply haven't used Docker as much as I have. Either way, I still contend that Dockerfiles have no room in a source code repository.
- avip 7y agoI'm in agreement with you that docker on windows is less enjoyable an experience. btw enabling VT-x is required for other tools as well (Android Studio for device emulation).
- jtchang 7y agoWhat would you recommend then? Dockerfiles are super useful in a source code repository and has saved me a ton of time.
- rumanator 7y ago> Because deployment tends to be very context-sensitive[1], Not with Docker. Docker makes that problem a thing of the past.