[Guide] ERPNext-14 Production Setup (Docker)

My project structure is just this

project-directory/

├── Dockerfile
├── apps/
│ ├── frappe/
│ ├── erpnext/
│ ├── hrms/
│ └── payments/

└── …

Is there any pre-requisites need for this apart from docker installation, Such as having a particular user name or any other steps

Because when i excecuted this
docker compose --project-name hrms-one -f ~/gitops/hrms-one.yaml up -d

I got this,
[+] Running 9/9
:heavy_check_mark: Container hrms-one-redis-cache-1 Running 0.0s
:heavy_check_mark: Container hrms-one-redis-queue-1 Running 0.0s
:heavy_check_mark: Container hrms-one-configurator-1 Exited 5.0s
:heavy_check_mark: Container hrms-one-backend-1 Running 0.0s
:heavy_check_mark: Container hrms-one-scheduler-1 Running 0.0s
:heavy_check_mark: Container hrms-one-queue-short-1 Running 0.0s
:heavy_check_mark: Container hrms-one-websocket-1 Running 0.0s
:heavy_check_mark: Container hrms-one-queue-long-1 Running 0.0s
:heavy_check_mark: Container hrms-one-frontend-1 Running 0.0s

when i looking for status of all containers i found its breaking in this line
520f49d1e6bd customapp:1.0.0 “bash -c 'ls -1 apps…” 6 minutes ago Exited (0) About a minute ago hrms-one-configurator-1

when i try dont it manually: ls -1 apps
ls: cannot access ‘apps’: No such file or directory

Is it because i dont have such path as mentioned in compose.yml?
path: /home/frappe/frappe-bench

PS: i dont have user called frappe, What should i do now

The Frappe user will be automatically created inside the container when you up the container.

Please share the more detail and what error your encountering

OK
docker compose --project-name hrms-one
–env-file ~/gitops/hrms-one.env
-f compose.yaml
-f overrides/compose.redis.yaml
-f overrides/compose.multi-bench.yaml
-f overrides/compose.multi-bench-ssl.yaml config > ~/gitops/hrms-one.yaml
sneha@DELL2301:~/Documents/hrms_frappe$ docker compose --project-name hrms-one -f ~/gitops/hrms-one.yaml up -d

[+] Running 10/10
:heavy_check_mark: redis-queue Pulled 9.3s
:heavy_check_mark: redis-cache Pulled 9.4s
:heavy_check_mark: ec99f8b99825 Pull complete 1.5s
:heavy_check_mark: bba4873ee85d Pull complete 1.9s
:heavy_check_mark: 9d368deeb8fc Pull complete 2.4s
:heavy_check_mark: 55ba6f41d822 Pull complete 2.8s
:heavy_check_mark: 675ef339ce0b Pull complete 3.4s
:heavy_check_mark: b6c4d5e603ad Pull complete 3.7s
:heavy_check_mark: 4f4fb700ef54 Pull complete 4.1s
:heavy_check_mark: 330342537750 Pull complete 4.5s
[+] Running 13/13
:heavy_check_mark: Network hrms-one Created 0.3s
:heavy_check_mark: Volume “hrms-one_redis-cache-data” Created 0.1s
:heavy_check_mark: Volume “hrms-one_sites” Created 0.0s
:heavy_check_mark: Volume “hrms-one_redis-queue-data” Created 0.0s
:heavy_check_mark: Container hrms-one-redis-cache-1 Started 10.8s
:heavy_check_mark: Container hrms-one-redis-queue-1 Started 10.4s
:heavy_check_mark: Container hrms-one-configurator-1 Exited 14.3s
:heavy_check_mark: Container hrms-one-queue-long-1 Started 19.1s
:heavy_check_mark: Container hrms-one-queue-short-1 Started 17.6s
:heavy_check_mark: Container hrms-one-websocket-1 Started 18.9s
:heavy_check_mark: Container hrms-one-backend-1 Started 17.1s
:heavy_check_mark: Container hrms-one-scheduler-1 Started 18.8s
:heavy_check_mark: Container hrms-one-frontend-1 Started 17.8s

sneha@DELL2301:~/Documents/hrms_frappe$ docker compose --project-name hrms-one exec backend
bench new-site hrms@prerana.com --no-mariadb-socket --mariadb-root-password [root] --install-app erpnext --admin-password admin
Traceback (most recent call last):
File “/usr/local/lib/python3.10/runpy.py”, line 196, in _run_module_as_main
return _run_code(code, main_globals, None,
File “/usr/local/lib/python3.10/runpy.py”, line 86, in _run_code
exec(code, run_globals)
File “/home/frappe/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, line 109, in
main()
File “/home/frappe/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, line 18, in main
click.Group(commands=commands)(prog_name=“bench”)
File “/home/frappe/frappe-bench/env/lib/python3.10/site-packages/click/core.py”, line 829, in call
return self.main(*args, **kwargs)
File “/home/frappe/frappe-bench/env/lib/python3.10/site-packages/click/core.py”, line 782, in main
rv = self.invoke(ctx)
File “/home/frappe/frappe-bench/env/lib/python3.10/site-packages/click/core.py”, line 1259, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/home/frappe/frappe-bench/env/lib/python3.10/site-packages/click/core.py”, line 1259, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/home/frappe/frappe-bench/env/lib/python3.10/site-packages/click/core.py”, line 1066, in invoke
return ctx.invoke(self.callback, **ctx.params)
File “/home/frappe/frappe-bench/env/lib/python3.10/site-packages/click/core.py”, line 610, in invoke
return callback(*args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/commands/site.py”, line 70, in new_site
_new_site(
File “/home/frappe/frappe-bench/apps/frappe/frappe/installer.py”, line 80, in _new_site
install_db(
File “/home/frappe/frappe-bench/apps/frappe/frappe/installer.py”, line 154, in install_db
setup_database(force, source_sql, verbose, no_mariadb_socket)
File “/home/frappe/frappe-bench/apps/frappe/frappe/database/init.py”, line 20, in setup_database
return frappe.database.mariadb.setup_db.setup_database(
File “/home/frappe/frappe-bench/apps/frappe/frappe/database/mariadb/setup_db.py”, line 36, in setup_database
if force or (db_name not in dbman.get_database_list()):
File “/home/frappe/frappe-bench/apps/frappe/frappe/database/db_manager.py”, line 49, in get_database_list
return self.db.sql(“SHOW DATABASES”, pluck=True)
File “/home/frappe/frappe-bench/apps/frappe/frappe/database/database.py”, line 221, in sql
self.connect()
File “/home/frappe/frappe-bench/apps/frappe/frappe/database/database.py”, line 126, in connect
self._conn: “MariadbConnection” | “PostgresConnection” = self.get_connection()
File “/home/frappe/frappe-bench/apps/frappe/frappe/database/mariadb/database.py”, line 103, in get_connection
conn = self._get_connection()
File “/home/frappe/frappe-bench/apps/frappe/frappe/database/mariadb/database.py”, line 109, in _get_connection
return self.create_connection()
File “/home/frappe/frappe-bench/apps/frappe/frappe/database/mariadb/database.py”, line 112, in create_connection
return pymysql.connect(**self.get_connection_settings())
File “/home/frappe/frappe-bench/env/lib/python3.10/site-packages/pymysql/connections.py”, line 361, in init
self.connect()
File “/home/frappe/frappe-bench/env/lib/python3.10/site-packages/pymysql/connections.py”, line 669, in connect
self._request_authentication()
File “/home/frappe/frappe-bench/env/lib/python3.10/site-packages/pymysql/connections.py”, line 957, in _request_authentication
auth_packet = self._read_packet()
File “/home/frappe/frappe-bench/env/lib/python3.10/site-packages/pymysql/connections.py”, line 775, in _read_packet
packet.raise_for_error()
File “/home/frappe/frappe-bench/env/lib/python3.10/site-packages/pymysql/protocol.py”, line 219, in raise_for_error
err.raise_mysql_exception(self._data)
File “/home/frappe/frappe-bench/env/lib/python3.10/site-packages/pymysql/err.py”, line 150, in raise_mysql_exception
raise errorclass(errno, errval)
pymysql.err.OperationalError: (1045, “Access denied for user ‘root’@‘172.19.0.9’ (using password: YES)”)

Why am i encountering this error?? I thought that container not running was the main reason for this error, apart from this i didnt encounter any error so far

Should my DB_PASSWORD in mariadb.env and HASHED_PASSWORD in traefik.env be the same?

if you DB_PASSWORD is 123

The HASHED_PASSWORD is in hash format.

its not the same

your site may crashed or not set it properly. please create new site with proper site name.

hrms@prerana.com 

this is a mail format. its not a site format

@Antony_Praveenkumar I have follow all process how to acces the erpnext ?

On domain or on IP ?

you should access the erpnext with your domain

ok thanks it working

1 Like

@revant_one @Antony_Praveenkumar traefik is renew the ssl certificate ? after the expire ? or any another method

Its renew automatically every three months.

1 Like

@Antony_Praveenkumar @revant_one

We did a frappe installation using the frappe-docker but we face one issue

When we exec into docker and make some changes inside frappe apps this changes is not reflected after the reload
At same time when we make some changes inside the ERPNext app codebase these changes are reflected so can please help us to find out the issue.

please help

for more info

please check

Build custom image, read FAQ. Frequently Asked Questions · frappe/frappe_docker Wiki · GitHub

1 Like

You should use Custom APP. Don’t change code in frappe or erpnext or any other app. create own custom app and override other app functionality from there.

1 Like

You DO NOT need following:

  • for custom frappe pass FRAPPE_PATH=<your url url> and FRAPPE_BRANCH=<your repo branch>
  • for custom ERPNext use your fork repo url and fork repo branch in apps.json
1 Like

@revant_one thanks for replay

suppose we fork the frappe and erpnext repo and make some changes according to me and build image.

But if i want to update v14.70.1 to v14.70.2 . Due to iam fork that repo so we can get the benifit of this ?

What can i do sync fork or pull request ?

note - code i have changes is not changes when we do fork or pull request ?

please suggust me .

Or is there any conflicts at the time of request

That’s why you do not need this.

Use this approach instead,

If you are a contributor, your fork is ahead of frappe and after merge you know what will be synced, go ahead fork. Eventually you will be in sync with upstream.

If you fork and diverge, you are on your own with your own strategies to sync.

1 Like