

Vagrant with Docker: How to set up Postgres, Elasticsearch and Redis on Mac OS X - grahar64
http://maori.geek.nz/post/vagrant_with_docker_how_to_set_up_postgres_elasticsearch_and_redis_on_mac_os_x

======
andredublin
I have done something similar to this with a MEAN stack where I boot docker
containers inside a single vagrant vm that is provisioned with shell scripts.
The containers then have their ports exposed to vagrant up to my localhost so
I can interact with each container individually. I should write a blog post
about this soon.

~~~
ericclemmons
I would love to see your Vagrantfile! I have a similar need, but can't figure
it out :(

------
revscat
> I cannot yet see where this "Vagrant with Docker" path is going. However,
> after seeing what is possible I cannot help but think about how else it can
> be used. Plus, it is the most fun I have ever had with virtualisation, and
> fun is what programming is all about.

For me the biggest benefit is being able to have a developer workstation setup
in minutes that (more-or-less) mirrors the production environment. This has
big benefits for simplifying development setup as well as making testing more
realistic.

------
eunoia
Have you looked into Fig?
([http://orchardup.github.io/fig/](http://orchardup.github.io/fig/))

I use it to accomplish something very similar, standardized dev environments
on OS X through docker containers.

Edit: I should probably add that my dev environment also relies on containers
running both Postgres and Redis.

~~~
gault8121
If you have the time, could you please review our docker + fig instructions?
These instructions are for Quill.org, a web app that provides free writing
activities to middle school and high school students.

[https://github.com/empirical-
org/Documentation/blob/master/G...](https://github.com/empirical-
org/Documentation/blob/master/Getting-Started/Install/Install%20Guide.md)

We are a non-profit, open source community, and we recently set up our dev
environment in Docker to encourage OSS contributions. We may be missing a few
crucial pieces of instruction for developers unfamiliar with Docker, such as
killing docker images once a developer is finished working on a project.

You can reach me at peter at quill.org

~~~
eunoia
Sent you an email

------
Hates_
As someone who uses brew versions of postgres, elasticsearch and redis, what
benefit would I get moving to a setup like this?

~~~
jives
If you have multiple people on your team, a common dev environment can be a
huge time-saver. New developers can install an identical environment quickly.

Another benefit is that your project's development environment is self-
contained. It's not going to clash with anything else on your system, and will
even work across platforms.

~~~
alaskamiller
More direct question:

Our team uses virtualenv and pip install from requirement lists. What
additional benefits does Docker offer?

~~~
radnam
You can do a pip install of python bindings but not the source package itself.
For e.g., pip install redis gets you python bindings for the redis but not
redis itself. With this setup, you can install a specific version of redis,
run it as a service with your custom configuration right out of the box.

~~~
alaskamiller
That's a good benefit for consideration, thanks for the answer.

------
chatman
This will drain your battery. Better is to use GNU/Linux natively, e.g.
Fedora, Ubuntu.

~~~
sfilipov
Please elaborate. Do you suggest to run Linux on the Mac or to run it in a VM?

I would think that one would get better battery life from running it in a VM,
especially a headless one compared to running Linux 'natively' mainly because
Linux desktop is notorious for worse battery life than Mac/Windows.

(yes there are ways to improve the out-of-the box battery life of Linux but
that's another topic)

~~~
l33tfr4gg3r
I think he means running Docker natively on a Linux distro of choice, since
LXC / Docker rely heavily on Linux kernel features to implement their
functionality (these do not run natively on Mac/Windows/etc). You can't run
Linux on a Mac other than running it inside a VM so the overhead as a result
would be a drain on battery life (at least that's what I assume chatman
means).

~~~
zrail
That's how I read it, and I agree with him. When I'm running a linux VM on my
Macbook Air the battery drains significantly faster than normal, even if the
VM isn't actually doing anything. It must have something to do with the way
that VirtualBox responds to power management from the host OS.

