Lightweight vagrant script

11 views
Skip to first unread message

Jack Yin

unread,
Mar 14, 2018, 5:04:52 AM3/14/18
to Vagrant
I push a lightweight vagrant script into github to make the machine configuration easy. 

{
    "ip": "172.16.6.6",
    "memory": 2048,
    "cpus": 2,
    "box": "ubuntu/xenial64",
    "name": "cjvagrant",
    "provider": "virtualbox",
    "authorize": "~/.ssh/id_rsa.pub",
    "keys": [
        "~/.ssh/id_rsa"
    ],
    /**
     * public fold within your project root path on the host machine
     * will map to /var/www/public within the guest machine.
     * Use options to specify the owner, group and write permission of the shared fold in guest machine.
     */
    "folders": [
        {
            "map": "./public",
            "to": "/var/www/public",
            "options": {
                 "owner": "ubuntu",
                 "group": "www-data",
                 "mount_options": [
                     "dmode=775",
                     "fmode=774"
                 ]
            }
        }
    ],
    /**
     * Set the virutal host and root directory for the site
     */
    "sites": [
        {
            "map": "cjvagrant.me",
            "to": "/var/www/public"
        }
    ],
    /**
     * Install the nginx, php7, mysql, redis in the guest machine.
     * If you want to install other dependencies, please put a bash script in the provision fold. 
     * Then add the script file name in the provisions list.
     */
    "provisions": [
        "install-nginx",
        "install-php7",
        "install-mysql",
        "install-redis"
    ],
    /**
     * Vagrant forwarded ports allow you to access a port on your host machine 
     * and have all data forwarded to a port on the guest machine, over either TCP or UDP.  
     */
    ports: [
        {
            "send": 8080,
            "to": 80
        },
        {
            "send": 3360,
            "to": 3306
        }
    ]
}


Please have a loot at https://github.com/tocjack/vagrant.
Reply all
Reply to author
Forward
0 new messages