Last active
August 29, 2015 14:02
-
-
Save micahlmartin/41d3d9eff16a0c147e8c to your computer and use it in GitHub Desktop.
Vagrant/Docker Setup
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- 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