From fdcc1cd120a26fd9179eecfc593105afe6442441 Mon Sep 17 00:00:00 2001 From: Revant Nandgaonkar Date: Mon, 18 May 2020 00:16:21 +0530 Subject: [PATCH 1/3] fix: typo and indent improve development/README.md fix indent devcontainer.json --- .devcontainer/devcontainer.json | 16 ++++++++-------- development/README.md | 12 +++++++----- 2 files changed, 15 insertions(+), 13 deletions(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 6c462bef..0640f28b 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -8,12 +8,12 @@ "dockerComposeFile": "./docker-compose.yml", "service": "frappe", "workspaceFolder": "/workspace/development", -"shutdownAction": "stopCompose", -"extensions": [ - "ms-python.python", - "auchenberg.vscode-browser-preview", - "grapecity.gc-excelviewer", - "mtxr.sqltools", - "visualstudioexptteam.vscodeintellicode" -] + "shutdownAction": "stopCompose", + "extensions": [ + "ms-python.python", + "auchenberg.vscode-browser-preview", + "grapecity.gc-excelviewer", + "mtxr.sqltools", + "visualstudioexptteam.vscodeintellicode" + ] } diff --git a/development/README.md b/development/README.md index 44ec78f4..dd43bed0 100644 --- a/development/README.md +++ b/development/README.md @@ -26,7 +26,7 @@ cd frappe_docker For most people getting started with Frappe development, the best solution is to use [ VSCode Remote - Containers extension](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers). -VSCode should automatically inquiry you to install the required extensions, that can also be installed manually as follows: +VSCode should automatically inquire you to install the required extensions, that can also be installed manually as follows: - Install Remote - Containers for VSCode - through command line `code --install-extension ms-vscode-remote.remote-containers` @@ -84,23 +84,24 @@ sed -i '/redis/d' ./Procfile You can create a new site with the following command: ```shell -bench new-site sitename +bench new-site sitename --no-mariadb-socket ``` for example: ```shell -bench new-site mysite.localhost +bench new-site mysite.localhost --no-mariadb-socket ``` The same command can be run non-interactively as well: ```shell -bench new-site mysite.localhost --mariadb-root-password 123 --admin-password admin +bench new-site mysite.localhost --mariadb-root-password 123 --admin-password admin --no-mariadb-socket ``` The command will ask the MariaDB root password. The default root password is `123`. This will create a new site and a `mysite.localhost` directory under `frappe-bench/sites`. +The option `--no-mariadb-socket` will configure site's database credentials to work with docker. You may need to configure your system /etc/hosts if you're on Linux, Mac, or its Windows equivalent. ### Set bench developer mode on the new site @@ -206,7 +207,8 @@ The first command can take a few seconds to be executed, this is to be expected. ### Fixing MariaDB issues after rebuilding the container -The `bench new-site` command creates a user in MariaDB with container IP as host, for this reason after rebuilding the container there is a chance that you will not be able to access MariaDB correctly with the previous configuration +For any reason after rebuilding the container if you are not be able to access MariaDB correctly with the previous configuration. Follow these instructions. + The parameter `'db_name'@'%'` needs to be set in MariaDB and permission to the site database suitably assigned to the user. This step has to be repeated for all sites available under the current bench. From 20f1fa0000f5cbe7533be01321ef55e3dc46d24a Mon Sep 17 00:00:00 2001 From: Revant Nandgaonkar Date: Mon, 18 May 2020 00:18:08 +0530 Subject: [PATCH 2/3] chore: update frappe/bench image use latest nodejs v10 and v12 use cloned bench for bench development --- build/bench/Dockerfile | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/build/bench/Dockerfile b/build/bench/Dockerfile index 8bb85e5f..51079700 100644 --- a/build/bench/Dockerfile +++ b/build/bench/Dockerfile @@ -63,8 +63,10 @@ RUN echo "frappe ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers USER frappe WORKDIR /home/frappe -# Install bench in the local user home directory -RUN pip3 install --user git+https://github.com/frappe/bench.git#egg=bench --no-cache +# Clone and install bench in the local user home directory +# For development, bench source is located in ~/.bench +RUN git clone https://github.com/frappe/bench.git .bench \ + && pip3 install --user -e .bench # Export python executables for Dockerfile ENV PATH=/home/frappe/.local/bin:$PATH @@ -81,8 +83,8 @@ RUN bash -c "bench --version" # https://nodejs.org/download/release/latest-v10.x/ # https://nodejs.org/download/release/latest-v12.x/ # https://nodejs.org/download/release/latest-v13.x/ -ENV NODE_VERSION=12.16.1 -ENV NODE_VERSION_FRAPPEV11=10.19.0 +ENV NODE_VERSION=12.16.3 +ENV NODE_VERSION_FRAPPEV11=10.20.1 # Install nvm with node RUN wget https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh From b057e12bdce16681e0337a9c64fc0dfbd3b6478b Mon Sep 17 00:00:00 2001 From: Revant Nandgaonkar Date: Tue, 19 May 2020 12:10:09 +0530 Subject: [PATCH 3/3] update: use wkhtmltopdf for buster_amd64 --- build/bench/Dockerfile | 4 ++-- build/frappe-worker/Dockerfile | 4 ++-- build/frappe-worker/v11.Dockerfile | 4 ++-- build/frappe-worker/v12.Dockerfile | 4 ++-- build/frappe-worker/v13-beta.Dockerfile | 4 ++-- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/build/bench/Dockerfile b/build/bench/Dockerfile index 51079700..5b2a67eb 100644 --- a/build/bench/Dockerfile +++ b/build/bench/Dockerfile @@ -53,8 +53,8 @@ RUN sed -i -e 's/# en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen \ && dpkg-reconfigure --frontend=noninteractive locales # Install wkhtmltox correctly -RUN wget https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/0.12.5/wkhtmltox_0.12.5-1.stretch_amd64.deb -RUN dpkg -i wkhtmltox_0.12.5-1.stretch_amd64.deb && rm wkhtmltox_0.12.5-1.stretch_amd64.deb +RUN wget https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/0.12.5/wkhtmltox_0.12.5-1.buster_amd64.deb +RUN dpkg -i wkhtmltox_0.12.5-1.buster_amd64.deb && rm wkhtmltox_0.12.5-1.buster_amd64.deb # Create new user with home directory, improve docker compatibility with UID/GID 1000, add user to sudo group, allow passwordless sudo, switch to that user and change directory to user home directory RUN groupadd -g 1000 frappe diff --git a/build/frappe-worker/Dockerfile b/build/frappe-worker/Dockerfile index 337f43e8..33e034ec 100644 --- a/build/frappe-worker/Dockerfile +++ b/build/frappe-worker/Dockerfile @@ -18,8 +18,8 @@ RUN install_packages \ build-essential # Install wkhtmltox correctly -RUN wget https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/0.12.5/wkhtmltox_0.12.5-1.stretch_amd64.deb -RUN dpkg -i wkhtmltox_0.12.5-1.stretch_amd64.deb && rm wkhtmltox_0.12.5-1.stretch_amd64.deb +RUN wget https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/0.12.5/wkhtmltox_0.12.5-1.buster_amd64.deb +RUN dpkg -i wkhtmltox_0.12.5-1.buster_amd64.deb && rm wkhtmltox_0.12.5-1.buster_amd64.deb RUN mkdir -p apps logs commands /home/frappe/backups diff --git a/build/frappe-worker/v11.Dockerfile b/build/frappe-worker/v11.Dockerfile index 6d9384cb..055db258 100644 --- a/build/frappe-worker/v11.Dockerfile +++ b/build/frappe-worker/v11.Dockerfile @@ -15,8 +15,8 @@ RUN install_packages \ xfonts-base # Install wkhtmltox correctly -RUN wget https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/0.12.5/wkhtmltox_0.12.5-1.stretch_amd64.deb -RUN dpkg -i wkhtmltox_0.12.5-1.stretch_amd64.deb && rm wkhtmltox_0.12.5-1.stretch_amd64.deb +RUN wget https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/0.12.5/wkhtmltox_0.12.5-1.buster_amd64.deb +RUN dpkg -i wkhtmltox_0.12.5-1.buster_amd64.deb && rm wkhtmltox_0.12.5-1.buster_amd64.deb RUN mkdir -p apps logs commands /home/frappe/backups diff --git a/build/frappe-worker/v12.Dockerfile b/build/frappe-worker/v12.Dockerfile index f923e26d..2e6a11f8 100644 --- a/build/frappe-worker/v12.Dockerfile +++ b/build/frappe-worker/v12.Dockerfile @@ -18,8 +18,8 @@ RUN install_packages \ build-essential # Install wkhtmltox correctly -RUN wget https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/0.12.5/wkhtmltox_0.12.5-1.stretch_amd64.deb -RUN dpkg -i wkhtmltox_0.12.5-1.stretch_amd64.deb && rm wkhtmltox_0.12.5-1.stretch_amd64.deb +RUN wget https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/0.12.5/wkhtmltox_0.12.5-1.buster_amd64.deb +RUN dpkg -i wkhtmltox_0.12.5-1.buster_amd64.deb && rm wkhtmltox_0.12.5-1.buster_amd64.deb RUN mkdir -p apps logs commands /home/frappe/backups diff --git a/build/frappe-worker/v13-beta.Dockerfile b/build/frappe-worker/v13-beta.Dockerfile index 1f2ed290..1ea82ac4 100644 --- a/build/frappe-worker/v13-beta.Dockerfile +++ b/build/frappe-worker/v13-beta.Dockerfile @@ -18,8 +18,8 @@ RUN install_packages \ build-essential # Install wkhtmltox correctly -RUN wget https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/0.12.5/wkhtmltox_0.12.5-1.stretch_amd64.deb -RUN dpkg -i wkhtmltox_0.12.5-1.stretch_amd64.deb && rm wkhtmltox_0.12.5-1.stretch_amd64.deb +RUN wget https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/0.12.5/wkhtmltox_0.12.5-1.buster_amd64.deb +RUN dpkg -i wkhtmltox_0.12.5-1.buster_amd64.deb && rm wkhtmltox_0.12.5-1.buster_amd64.deb RUN mkdir -p apps logs commands /home/frappe/backups