From 945a9e397963cf25854abd2f68a715c18bb875e3 Mon Sep 17 00:00:00 2001 From: Sam Prasad Date: Sun, 31 May 2020 20:02:55 -0400 Subject: [PATCH 1/9] Updated VSCode Remote Containers extension As I was going through the installation process, I noticed the steps for VSCode Remote Containers were a little unclear. I also a fixed a typo in Line 14 --- development/README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/development/README.md b/development/README.md index 77152d90..ccad94a5 100644 --- a/development/README.md +++ b/development/README.md @@ -11,7 +11,7 @@ In order to start developing you need to satisfy the following prerequisites: It is recommended you allocate at least 4GB of RAM to docker: - [Instructions for Windows](https://docs.docker.com/docker-for-windows/#resources) -- [Instructions for MacOOS](https://docs.docker.com/docker-for-mac/#resources) +- [Instructions for macOS](https://docs.docker.com/docker-for-mac/#resources) ## Bootstrap Containers for development @@ -30,8 +30,8 @@ VSCode should automatically inquire you to install the required extensions, that - Install Remote - Containers for VSCode - through command line `code --install-extension ms-vscode-remote.remote-containers` - - clicking on the button at the following link: [Remote - Containers](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers) - - searching for extension `ms-vscode-remote.remote-containers` + - clicking on the Install button in the Vistual Studio Marketplace: [Remote - Containers](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers) + - View: Extensions command in VSCode (Windows: Ctrl+Shift+X; macOS: Cmd+Shift+X) then search for extension `ms-vscode-remote.remote-containers` After the extensions are installed, you can: From a5b8db6137d82eb1b1e7f3df9a7c13eb3d8fc82e Mon Sep 17 00:00:00 2001 From: africlouds Date: Tue, 9 Jun 2020 07:33:20 +0200 Subject: [PATCH 2/9] Set /workspace/development as default working dir When one misses the part of the doc that says bench should be created under /workspace/development, bench is created in home directory and the work would be lost when the container is recreated. Making the directory default would avert that --- .devcontainer/docker-compose.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.devcontainer/docker-compose.yml b/.devcontainer/docker-compose.yml index 43498259..e4346512 100644 --- a/.devcontainer/docker-compose.yml +++ b/.devcontainer/docker-compose.yml @@ -23,6 +23,7 @@ services: command: sleep infinity volumes: - ..:/workspace:cached + working_dir: /workspace/development ports: - "8000:8000" - "9000:9000" From 450e1b64aa9c982e3d3e26b4a8ce456b0de17ea1 Mon Sep 17 00:00:00 2001 From: africlouds Date: Wed, 10 Jun 2020 09:19:23 +0200 Subject: [PATCH 3/9] Added Dockerfile for dev env Exposing port range 8000-8005 and 9000-9005. The Dockerfile allows easy extending the upstream bench image for development purpose --- .devcontainer/Dockerfile | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 .devcontainer/Dockerfile diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile new file mode 100644 index 00000000..85ef0a5a --- /dev/null +++ b/.devcontainer/Dockerfile @@ -0,0 +1,2 @@ +FROM frappe/bench:latest +EXPOSE 8000-8005 9000-9005 6787 From aa8e7d374c1feb60cdf3d8addacbda97356c1470 Mon Sep 17 00:00:00 2001 From: africlouds Date: Wed, 10 Jun 2020 09:22:47 +0200 Subject: [PATCH 4/9] Build frappe with Dockerfile - Build frappe image using development Dockerfile instead of bench:latest image - Exposing port range --- .devcontainer/docker-compose.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.devcontainer/docker-compose.yml b/.devcontainer/docker-compose.yml index e4346512..3b0907c5 100644 --- a/.devcontainer/docker-compose.yml +++ b/.devcontainer/docker-compose.yml @@ -19,14 +19,14 @@ services: image: redis:alpine frappe: - image: frappe/bench:latest + build: . command: sleep infinity volumes: - ..:/workspace:cached working_dir: /workspace/development ports: - - "8000:8000" - - "9000:9000" + - "8000-8005:8000-8005" + - "9000-9005:9000-9005" volumes: mariadb-vol: From 84bf55860a81edd8832b4215f4cae89c30afe76d Mon Sep 17 00:00:00 2001 From: africlouds Date: Wed, 10 Jun 2020 09:28:38 +0200 Subject: [PATCH 5/9] Updated Docs for multi bench --- development/README.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/development/README.md b/development/README.md index ccad94a5..778ee82b 100644 --- a/development/README.md +++ b/development/README.md @@ -243,7 +243,10 @@ EXIT; ## Manually start containers In case you don't use VSCode, you may start the containers manually with the following command: - +```shell +cd .devcontainer +docker-compose build +``` ```shell docker-compose -f .devcontainer/docker-compose.yml up -d ``` From 8ca5879211e5247df2a161c6d502d86ecbdb98ba Mon Sep 17 00:00:00 2001 From: africlouds Date: Wed, 10 Jun 2020 09:30:57 +0200 Subject: [PATCH 6/9] Updated build images commands Before starting the images, build the frappe images --- development/README.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/development/README.md b/development/README.md index 778ee82b..24bac719 100644 --- a/development/README.md +++ b/development/README.md @@ -243,10 +243,15 @@ EXIT; ## Manually start containers In case you don't use VSCode, you may start the containers manually with the following command: + +### Building the containers ```shell cd .devcontainer docker-compose build +cd .. ``` + +### Running the containers ```shell docker-compose -f .devcontainer/docker-compose.yml up -d ``` From daef926b069bebf8667119f9cb8ccc8fd3a50d87 Mon Sep 17 00:00:00 2001 From: Revant Nandgaonkar Date: Thu, 11 Jun 2020 12:55:27 +0530 Subject: [PATCH 7/9] feat(frappe/bench): allow 5 benches --- .devcontainer/docker-compose.yml | 2 +- build/bench/Dockerfile | 2 +- development/README.md | 7 ------- 3 files changed, 2 insertions(+), 9 deletions(-) diff --git a/.devcontainer/docker-compose.yml b/.devcontainer/docker-compose.yml index 3b0907c5..b0a1e6d6 100644 --- a/.devcontainer/docker-compose.yml +++ b/.devcontainer/docker-compose.yml @@ -19,7 +19,7 @@ services: image: redis:alpine frappe: - build: . + image: frappe/bench:latest command: sleep infinity volumes: - ..:/workspace:cached diff --git a/build/bench/Dockerfile b/build/bench/Dockerfile index 5b2a67eb..03ad4bad 100644 --- a/build/bench/Dockerfile +++ b/build/bench/Dockerfile @@ -113,4 +113,4 @@ RUN bash -c "node --version" \ && bash -c "npm --version" \ && bash -c "yarn --version" -EXPOSE 8000 9000 6787 +EXPOSE 8000-8005 9000-9005 6787 diff --git a/development/README.md b/development/README.md index 24bac719..030bfe35 100644 --- a/development/README.md +++ b/development/README.md @@ -244,13 +244,6 @@ EXIT; In case you don't use VSCode, you may start the containers manually with the following command: -### Building the containers -```shell -cd .devcontainer -docker-compose build -cd .. -``` - ### Running the containers ```shell docker-compose -f .devcontainer/docker-compose.yml up -d From 306d7e73dae6ab4f4fbad65a3ae22aa74cd90741 Mon Sep 17 00:00:00 2001 From: Revant Nandgaonkar Date: Thu, 11 Jun 2020 13:43:27 +0530 Subject: [PATCH 8/9] feat(frappe/bench): delete devcontainer Dockerfile Delete additional Dockerfile from .devcontainer [skip travis] --- .devcontainer/Dockerfile | 2 -- 1 file changed, 2 deletions(-) delete mode 100644 .devcontainer/Dockerfile diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile deleted file mode 100644 index 85ef0a5a..00000000 --- a/.devcontainer/Dockerfile +++ /dev/null @@ -1,2 +0,0 @@ -FROM frappe/bench:latest -EXPOSE 8000-8005 9000-9005 6787 From c618bd86d9a027e7973b870de0b03711f6afa840 Mon Sep 17 00:00:00 2001 From: Revant Nandgaonkar Date: Fri, 12 Jun 2020 23:12:52 +0530 Subject: [PATCH 9/9] feat: wait for connection before creating site --- build/common/worker/docker-entrypoint.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/build/common/worker/docker-entrypoint.sh b/build/common/worker/docker-entrypoint.sh index d07e3cb6..d6194c17 100755 --- a/build/common/worker/docker-entrypoint.sh +++ b/build/common/worker/docker-entrypoint.sh @@ -125,7 +125,8 @@ elif [ "$1" = 'schedule' ]; then fi elif [ "$1" = 'new' ]; then - + checkConfigExists + checkConnection if [[ -z "$RUN_AS_ROOT" ]]; then su frappe -c ". /home/frappe/frappe-bench/env/bin/activate \ && python /home/frappe/frappe-bench/commands/new.py"