From 5e84e477ac8f2b44d21024ff7f16ac082ded3904 Mon Sep 17 00:00:00 2001 From: vishalseshagiri Date: Mon, 24 Jul 2017 15:19:32 +0530 Subject: [PATCH 1/8] start-container became build-container, added new start-container and updated README.md --- README.md | 83 ++++++++++++++++++++++++++++++++++++---------- build-container.sh | 10 ++++++ start-container.sh | 10 +----- 3 files changed, 77 insertions(+), 26 deletions(-) create mode 100755 build-container.sh diff --git a/README.md b/README.md index ff3f43fe..33649da0 100644 --- a/README.md +++ b/README.md @@ -18,45 +18,94 @@ docker-compose ### Installing A step by step series of examples that tell you have to get a development env running +#### 1. Installation Pre-requisites -Installing Docker Community Edition +- Installing Docker Community Edition ``` -Follow the steps given in https://docs.docker.com/engine/installation/linux/docker-ce/ubuntu/ +Follow the steps given in https://docs.docker.com/engine/installation The Docker version used by us is Docker version 17.06.0-ce, build 02c1d87 ``` -Installing docker-compose +- Installing docker-compose ``` -Follow the steps given in https://docs.docker.com/compose/install/ +Follow the steps given in (Docker for Mac, Docker for Windows, and Docker Toolbox include Docker Compose) https://docs.docker.com/compose/install/ The docker-compose version used by us is docker-compose version 1.14.0, build c7bdf9e ``` -## Deployment +#### 2. Build the container and install bench + +* Make sure your logged in as root. Build the container and install bench inside the container as a **non root** user + source build-container.sh +Note: Please do not remove the bench directory the above commands will create + +#### Basic Usage +* Starting docker containers + docker-compose start + docker-compose stop + +* Accessing the frappe container via CLI + ./start-container.sh + +* Set the db host for bench(points bench to the mariadb container) + bench set-mariadb-host mariadb + +* Create a new bench + + The init command will create a bench directory with frappe framework + installed. It will be setup for periodic backups and auto updates once + a day. + + bench init frappe-bench && cd frappe-bench + +* Add a site + + Frappe apps are run by frappe sites and you will have to create at least one + site. The new-site command allows you to do that. + + bench new-site site1.local + +* Add apps + + The get-app command gets remote frappe apps from a remote git repository and installs them. Example: [erpnext](https://github.com/frappe/erpnext) + + bench get-app erpnext https://github.com/frappe/erpnext + +* Install apps + + To install an app on your new site, use the bench `install-app` command. + + bench --site site1.local install-app erpnext + +* Exiting the frappe container and stopping all the containers gracefully + exit + docker-compose stop + +* Removing docker containers + docker-compose rm + +* Removing dangling volumes + docker volume rm $(docker volume ls -f dangling=true -q) + +To login to Frappe / ERPNext, open your browser and go to `[your-external-ip]:8000`, probably `localhost:8000` + + The default username is "Administrator" and password is what you set when you created the new site. + +* -Steps to be followed to build and run the docker image are : -``` -1. Run the start-container script -2. After a few minutes the prompt will point to the App container with a root prefix to it (your current location is /home/frappe) -3. You will be inside /home/frappe/code folder -4. Make the bash_run_container.sh executable by chmod +x as in step 1 and run it with the command ./bash_run_container.sh -5. Run the bash_for_container.sh file with the command ./bash_for_container.sh -6. You will be prompted to enter the Mysql db password it is 123 -7. You will be prompted to choose and enter an administrator password please enter and remember it for future use -8. Once all the installation steps are complete you can access the Web based GUI by typing localhost:8000 on your browser. ## Built With * [Docker](https://www.docker.com/) ## Contributing -Feel free to contribute to this and make the container better +Feel free to contribute to this project and make the containers better ## Authors -* **Vishal Seshagiri** - *Initial work* - [FrappeBench](https://github.com/frappe/bench) +* **Vishal Seshagiri** See also the list of [contributors](https://github.com/your/project/contributors) who participated in this project. diff --git a/build-container.sh b/build-container.sh new file mode 100755 index 00000000..8812299b --- /dev/null +++ b/build-container.sh @@ -0,0 +1,10 @@ +echo "Enter a password for your database " +read DB_PASS + +echo 'export DB_PASS='$DB_PASS >> ~/.bashrc +source ~/.bashrc + +docker-compose up -d +app_id=`docker ps | grep docker_frappe | awk {'print $1'}` + +docker exec -it $app_id bash -c './setup.sh; exec "${SHELL:-sh}"' diff --git a/start-container.sh b/start-container.sh index 2c600b05..aa890566 100755 --- a/start-container.sh +++ b/start-container.sh @@ -1,11 +1,3 @@ -echo "Enter a password for your database " -read DB_PASS - -echo 'export DB_PASS='$DB_PASS >> ~/.bashrc -source ~/.bashrc - -docker-compose up -d app_id=`docker ps | grep docker_frappe | awk {'print $1'}` -docker exec -it $app_id bash -c './setup.sh; exec "${SHELL:-sh}"' - +docker exec -it $app_id bash -c 'cd /home/frappe/frappe-bench && su frappe; exec "${SHELL:-sh}"' From 219cd2b14a74b2250a8651365d1d8e4be1cda29e Mon Sep 17 00:00:00 2001 From: vishalseshagiri Date: Mon, 24 Jul 2017 15:30:18 +0530 Subject: [PATCH 2/8] Update README.md --- README.md | 32 ++++++++++++++++++++------------ 1 file changed, 20 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index 33649da0..630fccff 100644 --- a/README.md +++ b/README.md @@ -23,14 +23,14 @@ A step by step series of examples that tell you have to get a development env ru - Installing Docker Community Edition ``` -Follow the steps given in https://docs.docker.com/engine/installation +Follow the steps given in [here](https://docs.docker.com/engine/installation) The Docker version used by us is Docker version 17.06.0-ce, build 02c1d87 ``` -- Installing docker-compose +- Installing docker-compose(only for Linux users) ``` -Follow the steps given in (Docker for Mac, Docker for Windows, and Docker Toolbox include Docker Compose) https://docs.docker.com/compose/install/ +Follow the steps given in (Docker for Mac, Docker for Windows, and Docker Toolbox include Docker Compose) [here](https://docs.docker.com/compose/install/) The docker-compose version used by us is docker-compose version 1.14.0, build c7bdf9e ``` @@ -43,14 +43,17 @@ Note: Please do not remove the bench directory the above commands will create #### Basic Usage * Starting docker containers - docker-compose start - docker-compose stop + This command can be used to start containers + + docker-compose start * Accessing the frappe container via CLI - ./start-container.sh + + ./start-container.sh * Set the db host for bench(points bench to the mariadb container) - bench set-mariadb-host mariadb + + bench set-mariadb-host mariadb * Create a new bench @@ -81,20 +84,25 @@ Note: Please do not remove the bench directory the above commands will create * Exiting the frappe container and stopping all the containers gracefully exit - docker-compose stop + + docker-compose stop * Removing docker containers - docker-compose rm + + docker-compose rm * Removing dangling volumes - docker volume rm $(docker volume ls -f dangling=true -q) + The volume frappe on your local machine is shared by the host(your local machine) and the frappe container. + Please do not delete this volume from your local machine. Any changes made in this directory will reflect on both + the container and the host. The below command specifies how to remain dangling volumes which may be taking up + unecessary space on your host. + + docker volume rm $(docker volume ls -f dangling=true -q) To login to Frappe / ERPNext, open your browser and go to `[your-external-ip]:8000`, probably `localhost:8000` The default username is "Administrator" and password is what you set when you created the new site. -* - ## Built With * [Docker](https://www.docker.com/) From a72eefa3215bf4fbbfed9c58feb3b0a170f5457d Mon Sep 17 00:00:00 2001 From: vishalseshagiri Date: Mon, 24 Jul 2017 15:34:28 +0530 Subject: [PATCH 3/8] Update README.md --- README.md | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 630fccff..8d601475 100644 --- a/README.md +++ b/README.md @@ -22,18 +22,16 @@ A step by step series of examples that tell you have to get a development env ru - Installing Docker Community Edition -``` -Follow the steps given in [here](https://docs.docker.com/engine/installation) + Follow the steps given in [here](https://docs.docker.com/engine/installation) + + The Docker version used by us is Docker version 17.06.0-ce, build 02c1d87 -The Docker version used by us is Docker version 17.06.0-ce, build 02c1d87 -``` - Installing docker-compose(only for Linux users) -``` -Follow the steps given in (Docker for Mac, Docker for Windows, and Docker Toolbox include Docker Compose) [here](https://docs.docker.com/compose/install/) -The docker-compose version used by us is docker-compose version 1.14.0, build c7bdf9e -``` + Follow the steps given in (Docker for Mac, Docker for Windows, and Docker Toolbox include Docker Compose) [here](https://docs.docker.com/compose/install/) + + The docker-compose version used by us is docker-compose version 1.14.0, build c7bdf9e #### 2. Build the container and install bench From dd596df00084415761fb1af6eee8abd598099f62 Mon Sep 17 00:00:00 2001 From: vishalseshagiri Date: Mon, 24 Jul 2017 15:36:10 +0530 Subject: [PATCH 4/8] Update README.md --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 8d601475..f80c99e3 100644 --- a/README.md +++ b/README.md @@ -22,16 +22,16 @@ A step by step series of examples that tell you have to get a development env ru - Installing Docker Community Edition - Follow the steps given in [here](https://docs.docker.com/engine/installation) + Follow the steps given in [here](https://docs.docker.com/engine/installation) - The Docker version used by us is Docker version 17.06.0-ce, build 02c1d87 + The Docker version used by us is Docker version 17.06.0-ce, build 02c1d87 - Installing docker-compose(only for Linux users) - Follow the steps given in (Docker for Mac, Docker for Windows, and Docker Toolbox include Docker Compose) [here](https://docs.docker.com/compose/install/) + Follow the steps given in (Docker for Mac, Docker for Windows, and Docker Toolbox include Docker Compose) [here](https://docs.docker.com/compose/install/) - The docker-compose version used by us is docker-compose version 1.14.0, build c7bdf9e + The docker-compose version used by us is docker-compose version 1.14.0, build c7bdf9e #### 2. Build the container and install bench From 17d11bb7414a6f8b69a684f62083892e0a341d8f Mon Sep 17 00:00:00 2001 From: vishalseshagiri Date: Mon, 24 Jul 2017 15:37:57 +0530 Subject: [PATCH 5/8] Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index f80c99e3..be445429 100644 --- a/README.md +++ b/README.md @@ -24,14 +24,14 @@ A step by step series of examples that tell you have to get a development env ru Follow the steps given in [here](https://docs.docker.com/engine/installation) - The Docker version used by us is Docker version 17.06.0-ce, build 02c1d87 + The Docker version used by us is Docker version 17.06.0-ce, build 02c1d87 - Installing docker-compose(only for Linux users) Follow the steps given in (Docker for Mac, Docker for Windows, and Docker Toolbox include Docker Compose) [here](https://docs.docker.com/compose/install/) - The docker-compose version used by us is docker-compose version 1.14.0, build c7bdf9e + The docker-compose version used by us is docker-compose version 1.14.0, build c7bdf9e #### 2. Build the container and install bench From 2cd79101ba12494d57d727ea88c3c13d514ee93a Mon Sep 17 00:00:00 2001 From: vishalseshagiri Date: Mon, 24 Jul 2017 15:39:04 +0530 Subject: [PATCH 6/8] Update README.md --- README.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index be445429..3c439c87 100644 --- a/README.md +++ b/README.md @@ -36,8 +36,10 @@ A step by step series of examples that tell you have to get a development env ru #### 2. Build the container and install bench * Make sure your logged in as root. Build the container and install bench inside the container as a **non root** user - source build-container.sh -Note: Please do not remove the bench directory the above commands will create + + source build-container.sh + + Note: Please do not remove the bench directory the above commands will create #### Basic Usage * Starting docker containers From 23310bfb2985025b375c5fd232138a20b70eb7cb Mon Sep 17 00:00:00 2001 From: vishalseshagiri Date: Mon, 24 Jul 2017 15:41:59 +0530 Subject: [PATCH 7/8] Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 3c439c87..97b0b143 100644 --- a/README.md +++ b/README.md @@ -26,10 +26,10 @@ A step by step series of examples that tell you have to get a development env ru The Docker version used by us is Docker version 17.06.0-ce, build 02c1d87 -- Installing docker-compose(only for Linux users) +- Installing docker-compose(only for Linux users => Docker for Mac, Docker for Windows, and Docker Toolbox include Docker Compose) - Follow the steps given in (Docker for Mac, Docker for Windows, and Docker Toolbox include Docker Compose) [here](https://docs.docker.com/compose/install/) + Follow the steps given in [here](https://docs.docker.com/compose/install/) The docker-compose version used by us is docker-compose version 1.14.0, build c7bdf9e From f0a60fe45aa6834c6e491c3064a83caca0e24e77 Mon Sep 17 00:00:00 2001 From: vishalseshagiri Date: Mon, 24 Jul 2017 15:42:55 +0530 Subject: [PATCH 8/8] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 97b0b143..db52d0ac 100644 --- a/README.md +++ b/README.md @@ -26,7 +26,7 @@ A step by step series of examples that tell you have to get a development env ru The Docker version used by us is Docker version 17.06.0-ce, build 02c1d87 -- Installing docker-compose(only for Linux users => Docker for Mac, Docker for Windows, and Docker Toolbox include Docker Compose) +- Installing docker-compose(only for Linux users).Docker for Mac, Docker for Windows, and Docker Toolbox include Docker Compose Follow the steps given in [here](https://docs.docker.com/compose/install/)