Skip to content

Instantly share code, notes, and snippets.

@micahlmartin
Last active August 29, 2015 14:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save micahlmartin/41d3d9eff16a0c147e8c to your computer and use it in GitHub Desktop.
Save micahlmartin/41d3d9eff16a0c147e8c to your computer and use it in GitHub Desktop.
Vagrant/Docker Setup
FROM quirky/rails
RUN mkdir /opt/app
WORKDIR /opt/app
ADD ./Gemfile /opt/app/Gemfile
ADD ./Gemfile.lock /opt/app/Gemfile.lock
RUN bundle install
EXPOSE 3000
ADD . /opt/app
VOLUME /opt/app
# -*- mode: ruby -*-
# vi: set ft=ruby :
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.define "app" do |app|
app.vm.provider "docker" do |d|
d.build_dir = "."
d.link "db:db"
d.volumes = ["/vagrant:/opt/app"]
d.vagrant_vagrantfile = "VagrantHost"
end
end
config.vm.define "db" do |app|
app.vm.provider "docker" do |d|
d.image = "paintedfox/postgresql"
d.name = "db"
d.vagrant_vagrantfile = "VagrantHost"
end
end
end
# -*- mode: ruby -*-
# vi: set ft=ruby :
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.box = "hashicorp/precise64"
config.vm.provision "docker"
config.vm.provision "shell", inline: "ps aux | grep 'sshd:' | awk '{print $2}' | xargs kill"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment