GithubHelp home page GithubHelp logo

frappe-vagrant-tools's Introduction

Custom Vagrant V8 Setup

This guide is for setting up a frappe/erpnext vagrant box from scratch plus a few extra productivity goodies. Right now this guide is MACOS ONLY but most steps should work fairly similarly on Windows and much more so on Linux.

Make sure you have vagrant installed and virtual box:

https://www.vagrantup.com/

https://www.virtualbox.org/

info about vagrant and virtualbox:

https://www.vagrantup.com/docs/virtualbox/

Creating vagrant box.

Steps

  1. Clone this repo somewhere in your host machine, open a terminal and cd into the directory.

  2. Kick off vagrant box setup:

   vagrant up
  1. Go make some coffee this will take a while to create a test frappe site.
bench new-site frappe

Starting the dev instance of frappe

bench start

Mounting apps directory for ease of development MAC/LINUX Tested Only

You can use vagrant's file system sync feature to edit your apps in your host and making these changes immediately available to the frappe guest vm.

Steps

After you have built and initialized your vagrant box:

  1. Start up your vagrant box and ssh into it
   vagrant up
   vagrant ssh
  1. Move the apps directory in ~/frappe-bench/apps to your vagrant shared directory /vagrant/ and create mount point
   mv ~/frappe-bench/apps /vagrant/
   mkdir ~/frappe-bench/apps
  1. Edit ~/.profile add the following lines at the end of the file
   sudo mount --bind /vagrant/apps /home/vagrant/frappe-bench/apps
  1. Execute changes to .profil
   source ~/.profile

Your vagrant/apps folder now can be used on your host as well as guest without having to manualy syncronize any data. NOTE: There is a current issue with vagrant shared folders where inotify events will not trigger when files are updated from the host. This means that while working and saving files from the host, frappe will not detect file changes thus will not reload them. To get around this you must install vagrant-fsnotify and vagrant-triggers plugins. Their configuration variables are already available on the Vagrantfile. To install run the following in your vagrant vm folder:

   vagrant plugin install vagrant-fsnotify vagrant-triggers

(Optional) ssh-agent forwarding

To get your ssh key into your vagrant box add the following in the VagrantFile:

   Vagrant::Config.run do |config|
       config.ssh.forward_agent = true
   end

You must also enable your host's ssh agent. On linux and mac the following should work:

/usr/bin/ssh-add -K ~/.ssh/id_rsa

On macs you will have to add this to ~/.ssh/bash_profile due to keys being 'forgotten' on restarts

Proxy your frappe guest through your host's nginx

You can proxy your development frappe instance through your local nginx server to ease development through a custom local hostname or even make your local development instance available to the internet.

Make sure your instance is accessive first through:

http://127.0.0.1:8002

Macos

Steps

  1. Copy mac-nginx/conf.d/frappe-v8.conf to your local nginx config file
   cp ./mac-nginx/conf.d/frappe-v8.conf /usr/local/etc/nginx/conf.d/
  1. Edit your newly copied nginx config file and change the domain name to anything you like.
   server_name frappev8.dev;

to

   server_name myfrappe.dev;
  1. Edit your /etc/hosts file to point to your local nginx instance
   127.0.0.1  frappev8.dev

or if you changed your domain

   127.0.0.1  myfrappe.dev
  1. Start nginx
   sudo nginx

or reload it if already running

   sudo nginx -s reload
  1. Now you can access your dev frappe instace on your browser at:
   http://frappev8.dev

or if you changed your domain

   http://myfrappe.dev

frappe-vagrant-tools's People

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.