Question of the correct steps to create and install an application in a docker environment

Who can tell me the correct steps to create and install an application in docker environment?

I deployed the frappe environment using docker, and I wanted to try to create an application and enable it under the default frontend.

1: First, I did this by going directly into the container and executing the bench command. Is that a problem?

2: Secondly, after entering the container, I executed the following commands according to the official documents:

bench  new-app  books
bench --site frontend install-app books

Even after the error, I finally performed the following steps by querying the relevant information:

bench --site  frontend  migrate

There were no errors, and I restarted the container. Unfortunately, the page showed: Internal Server Error

Then I run docker logs -f frappe_docker-backend-1 , it output:

ModuleNotFoundError: No module named ‘books’
[2025-04-10 05:42:50 +0000] [6] [ERROR] Error handling request /
Traceback (most recent call last):
File “/home/frappe/frappe-bench/apps/frappe/frappe/website/serve.py”, line 19, in get_response
endpoint, renderer_instance = path_resolver.resolve()
^^^^^^^^^^^^^^^^^^^^^^^
File “/home/frappe/frappe-bench/apps/frappe/frappe/website/path_resolver.py”, line 68, in resolve
renderer_instance = renderer(endpoint, self.http_status_code)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/home/frappe/frappe-bench/apps/frappe/frappe/website/page_renderers/static_page.py”, line 30, in init
self.set_file_path()
File “/home/frappe/frappe-bench/apps/frappe/frappe/website/page_renderers/static_page.py”, line 37, in set_file_path
file_path = frappe.get_app_path(app, “www”) + “/” + self.path
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/home/frappe/frappe-bench/apps/frappe/frappe/init.py”, line 1465, in get_app_path
return get_pymodule_path(app_name, *joins)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/home/frappe/frappe-bench/apps/frappe/frappe/init.py”, line 1495, in get_pymodule_path
return abspath(join(dirname(get_module(scrub(modulename)).file or “”), *joins))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/home/frappe/frappe-bench/apps/frappe/frappe/init.py”, line 1436, in get_module
return importlib.import_module(modulename)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
^^^^^^^^^^^^^^^^^^^^^^^^
File “/home/frappe/frappe-bench/apps/frappe/frappe/init.py”, line 1465, in get_app_path
return get_pymodule_path(app_name, *joins)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/home/frappe/frappe-bench/apps/frappe/frappe/init.py”, line 1495, in get_pymodule_path
return abspath(join(dirname(get_module(scrub(modulename)).file or “”), *joins))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/home/frappe/frappe-bench/apps/frappe/frappe/init.py”, line 1436, in get_module
return importlib.import_module(modulename)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/usr/local/lib/python3.11/importlib/init.py”, line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “”, line 1204, in _gcd_import
File “”, line 1176, in _find_and_load
File “”, line 1140, in _find_and_load_unlocked
ModuleNotFoundError: No module named ‘books’

Who can tell me the correct steps to create and install an application in docker environment?

Where is he?

Read Frequently Asked Questions · frappe/frappe_docker Wiki · GitHub

Thank you for your reply!

I have a rough idea of the steps to create and install a custom application:

1: bench --site new-app appName

This step simply creates the appropriate structure and directory for the user, and the user can develop the application on this basis.

2: Upload the code to the user’s private repository on github, if using a third-party application, this step should be omitted.

3: Follow the guidelines in the following URL, mainly configure the application github URL in apps.json, and then you can execute bench --site install-app appName to install.

custom apps

From my personal use, I feel that the problem often lies in: many knowledge points are scattered and discontinuous, and it is difficult for users to connect these scattered knowledge, so there is often confusion, so if can explain the causes and consequences and related links in detail in the relevant documents, I think it may be better.

I don’t know if I’m right.

Steps you understood are correct.