Created
July 8, 2019 14:35
-
-
Save nboire/8bdd6f923e2684c7e1ef2145510194a5 to your computer and use it in GitHub Desktop.
Mac + Docker + Symfony via a vagrant box
This file contains hidden or 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 : | |
Vagrant.configure("2") do |config| | |
config.vm.box = "ubuntu/xenial64" | |
config.vm.network "public_network" | |
config.vm.synced_folder ".", "/vagrant", type: "rsync", | |
rsync__exclude: [".git/","app/cache", "app/logs", "var"] | |
config.vm.provider "virtualbox" do |v| | |
v.memory = 2048 | |
v.cpus = 2 | |
end | |
## installing docker & docker-compose on box | |
config.vm.provision "shell", inline: <<-SHELL | |
curl -fsSL https://get.docker.com -o get-docker.sh | |
sudo sh get-docker.sh | |
sudo usermod -aG docker vagrant | |
sudo curl -L --fail https://github.com/docker/compose/releases/download/1.24.0/run.sh -o /usr/local/bin/docker-compose | |
sudo chmod +x /usr/local/bin/docker-compose | |
SHELL | |
## Help messages | |
config.vm.post_up_message = <<-MESSAGE | |
All done! | |
To find IP address of vagrant box | |
vagrant ssh -c 'ifconfig' | |
To start docker : | |
vagrant ssh -c 'cd /vagrant && docker-compose up' | |
To start the files watcher for auto sync: | |
vagrant rsync-auto | |
MESSAGE | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment