Frappe Framework app development using docker

Quick Instructions for Starting Frappe Framework App Development using docker

 · 3 min read

Quick Instructions for Starting Frappe Framework App Development using Docker


Introduction:

What is Frappe Framework

Frappe Framework is an open-source web framework for building business applications. It provides a powerful and flexible platform for developers to build custom applications for businesses of all sizes. With the rise of containerization and the need for streamlined and efficient application deployment, the use of Docker for Frappe Framework app development has become increasingly popular.

What is Docker

Docker is a containerization platform that allows developers to package their applications and dependencies into containers. This provides a lightweight and portable way of deploying and running applications on any machine. Containers are isolated from each other, which helps to prevent any conflicts between different applications and their dependencies. This makes Docker an ideal platform for deploying Frappe Framework applications.

Using Docker for Frappe Framework App Development

The process of using Docker for Frappe Framework app development is straightforward.

  1. Developers on their Windows 10/11 system should first install WSL2 system.
  2. Developers then should install the latest version of Docker
  3. Download and install latest version of VS Code
  4. Login to WSL2 system based Linux distribution say Ubuntu
  5. Inside install git and create a frappe_docker directory
  6. run below commands
git clone https://github.com/frappe/frappe_docker.git
cd frappe_docker
cp -R devcontainer-example .devcontainer
cp -R development/vscode-example development/.vscode

  1. do configuration changes as required by editing .devcontainer/docker-compose.yml copied in above instruction
  2. Inside WSL 2 linux run following commands
  3. For Installing VS Code Developer Container Extension: code --install-extension ms-vscode-remote.remote-containers
  4. open frappe_docker folder in VS Code by following command: code .
  5. reopen the WSL 2 based development folder in development container by CTRL+SHIFT+P and selecting Reopen in Container.


Oh you are setup of VS Code with docker for your frappe development.

Next Step is now the setup of bench, adding and installing the apps over site(s).

Now you have two ways to do it

  1. Automatic Script to setup bench, create site and install apps defined in apps.json
  2. Manually: By choosing environment and apps


For purpose of this QuickStart blog, will choose Automatic Script.

Follow these steps to do so:

  1. Edit apps.json as per your requirement
  2. In VS code terminal (CTRL+SHIFT+`) run
cp apps-example.json apps.json
bash installer.sh

 Above steps will ask for details like

  1. Client name (for using name in default apps.json enter is client_name)
  2. bench directory name (default is frappe-bench)
  3. site name: this name should end with .localhost e.g. site1.localhost

 And, you are done with the installation of apps.


___

Concluding Remarks: One of the benefits of using Docker for Frappe Framework app development is that it provides a consistent environment for development, testing, and production. The Docker image can be tested on a local machine and then deployed to a production environment with confidence that it will run as expected. This helps to reduce the risk of environment-related issues and makes it easier for developers to focus on writing code.


Another advantage of using Docker for Frappe Framework app development is that it makes it easy to scale applications. Applications can be deployed as multiple containers, which can run on different machines. This makes it possible to scale applications horizontally by adding more containers, or vertically by increasing the resources of a single container. This allows developers to build highly scalable applications that can handle a large number of users and transactions.


In conclusion, using Docker for Frappe Framework app development provides many benefits for developers. It makes it easy to deploy and run applications, provides a consistent environment for development, testing, and production, and makes it easy to scale applications. With the growing popularity of Docker, it is a valuable tool for developers who want to build powerful and efficient applications using the Frappe Framework.


Official Blogger

Official Blog of Jmacaire Tech

No comments yet.

Add a comment
Ctrl+Enter to add comment