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?