3 ms·
Thanks for that detailed explanation. So it’s possible to pair Ansible with docker? Like only the app on docker but all the runtime, Apache, dependencies co
by kbrannigan 4y ago
Thanks for that detailed explanation.
So it’s possible to pair Ansible with docker?
Like only the app on docker but all the runtime, Apache, dependencies configured using Ansible ?
- spoiler 4y agoYes. Although, typically some od those other dependencies come with docker images themselves (such as Apache). Also, depending on your definition of dependency, some app dependencies need to live inside the image too (ie shared libraries, or app deps)
- kasey_junk 4y agoThat’s an extremely common mode of operating. Typically, if using bare nodes, you’ll see OS level concerns (disk, networking, init systems, etc) managed via a config management system, while app level concerns (lib dependencies, env variables, port setups, etc) managed via a container.
- nine_k 4y agoYes, it's possible to configure some aspects of your machine via Ansible, and run Docker containers on it. You can of course run a non-dockerized, locally configured Apache, and make it talk to backend code that lives in containers which just expose TCP ports or Unix sockets. It allows you to package all the dependency tree horrors of a Node app, or of a large Django app, into a container once, at build time, and just put them on a host where you run them. You're guaranteed to run exactly the same code on your prod box(es) which you've tested on your dev and CI boxes, with all dependencies, libraries, etc guaranteed the same, never reinstalled. Eventually you may discover that it's convenient to put the Apache into a container, too. Suddenly it stops depending on the distro your host is running. You may also not need to run Docker proper on your prod machine(s); in simpler cases systemd will start / restart your containers just as well. During development though, docker-compose is invaluable, it allows you to locally run nearly your prod configuration of services, at a tiny scale.