Created
June 18, 2015 07:09
-
-
Save ivancorrales/98e75e5696ef64654c6b to your computer and use it in GitHub Desktop.
Vagrantfile for running mongo mysql and postgresql with docker-compose
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
postgres: | |
image: postgres:9.4 | |
ports: | |
- "5432:5432" | |
environment: | |
- POSTGRES_USER=docker | |
- POSTGRES_PASSWORD=docker | |
mysql: | |
image: mysql | |
ports: | |
- "3306:3306" | |
environment: | |
- MYSQL_USER=docker | |
- MYSQL_PASSWORD=docker | |
- MYSQL_DATABASE=docker | |
- MYSQL_ROOT_PASSWORD=docker | |
mongo: | |
image: mongo:3 | |
command: "--smallfiles" | |
restart: always | |
mem_limit: 100MB | |
mongo: | |
image: mongo | |
ports: | |
- "27017:27017" |
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
#/bin/bash | |
vagrant plugin install vagrant-host-shell | |
vagrant plugin install vagrant-docker-compose | |
vagrant up --provision |
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
VAGRANTFILE_API_VERSION = "2" | |
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| | |
config.vm.box = "ubuntu/trusty64" | |
config.vm.provider :virtualbox do |vb| | |
vb.customize ["modifyvm", :id, "--memory", "1024", "--cpus", "2"] | |
end | |
config.vm.provision "shell", inline: | |
"curl -sSL https://get.docker.com/ | sh;curl -L https://github.com/docker/compose/releases/download/1.2.0/docker-compose-`uname -s`-`uname -m` > /usr/local/bin/docker-compose; chmod +x /usr/local/bin/docker-compose" | |
config.vm.provision :docker | |
config.vm.provision :docker_compose, yml: "/vagrant/docker-compose.yml", rebuild: true, run: "always" | |
config.vm.network :forwarded_port, guest: 5432, host: 7001 | |
config.vm.network :forwarded_port, guest: 3306, host: 7002 | |
config.vm.network :forwarded_port, guest: 27017, host: 7003 | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment