From 2e0a863ef7b47fc4c92062392df75ce59bdf63aa Mon Sep 17 00:00:00 2001 From: Davide Bortolami Date: Fri, 17 Apr 2020 00:34:22 +0100 Subject: [PATCH] Update documentation, add ssh-client to bench build, expose MariaDB port in development --- .devcontainer/docker-compose.yml | 2 ++ build/bench/Dockerfile | 1 + development/README.md | 29 ++++++++++++++++++++++++----- 3 files changed, 27 insertions(+), 5 deletions(-) diff --git a/.devcontainer/docker-compose.yml b/.devcontainer/docker-compose.yml index 43498259..383e60ef 100644 --- a/.devcontainer/docker-compose.yml +++ b/.devcontainer/docker-compose.yml @@ -8,6 +8,8 @@ services: volumes: - ../installation/frappe-mariadb.cnf:/etc/mysql/conf.d/frappe.cnf - mariadb-vol:/var/lib/mysql + ports: + - 3306:3306 redis-cache: image: redis:alpine diff --git a/build/bench/Dockerfile b/build/bench/Dockerfile index 78a2381c..8bb85e5f 100644 --- a/build/bench/Dockerfile +++ b/build/bench/Dockerfile @@ -39,6 +39,7 @@ RUN install_packages \ redis-tools \ rlwrap \ tk8.6-dev \ + ssh-client \ # VSCode container requirements net-tools \ # PYTHON diff --git a/development/README.md b/development/README.md index 2f08d3d1..cc01b0e9 100644 --- a/development/README.md +++ b/development/README.md @@ -47,7 +47,7 @@ Run the following commands in the terminal inside the container. You might need ```shell bench init --skip-redis-config-generation --frappe-branch version-12 frappe-bench -cd frappe-bench +cd frappe-bench∏ ``` ### Setup hosts @@ -78,6 +78,7 @@ sed -i '/redis/d' ./Procfile ### Create a new site with bench +Your installation already includes a site for [localhost](http://locahost:8000) You can create a new site with the following command: ```shell @@ -87,11 +88,20 @@ bench new-site sitename for example: ```shell -bench new-site localhost +bench new-site mysite.localhost ``` The command will ask the MariaDB root password. The default root password is `123`. -This will create a new site and a `localhost` directory under `frappe-bench/sites`. +This will create a new site and a `mysite.localhost` directory under `frappe-bench/sites`. +You may need to configure your system /etc/hosts if you're on Linux, Mac, or its Windows equivalent. + +### Launching + +To launch witho +```shell +bench new-site mysite.localhost +``` + Your website will now be accessible on [localhost on port 8000](http://locahost:8000) ### Set bench developer mode on the new site @@ -99,8 +109,17 @@ Your website will now be accessible on [localhost on port 8000](http://locahost: To develop a new app, the last step will be setting the site into developer mode. Documentation is available at [this link](https://frappe.io/docs/user/en/guides/app-development/how-enable-developer-mode-in-frappe). ```shell -bench set-config developer_mode 1 -bench clear-cache +bench --site my.site set-config developer_mode 1 +bench --site my.site clear-cache +``` + +### Install an app + +To install an app we need to fetch it from the appropriate git repo, then install in on the appropriate site + +```shell +bench get-app myapp https://github.com/myusername/myapp.git +bench --site my.site install-app myapp ``` ### Fixing MariaDB issues after rebuilding the container