Custom installation of ERPnext reachable remote with Docker Apache2

Hi everyone,
I need to install ERPnext on a Debian system ARM64.
This should be reachable from remote at the address mysite.owndns.net
The Debian system is in a network with local address 192.168.1.104
This machine hosts different Docker containers so I need to change the default values for ports to avoid conflicts.
I followed the instructions reported here but I think there is some errors about the settings of the variables, because the containers seems looking for the default values and not the set ones.
I set correctly the server redirect of the domain mysite.owndns.net with Apache2 and all is working on its side.
I downloaded this full repository
I did this setup for the file pwd.yml and the file .env.
I run the commands

docker buildx bake --no-cache --set "*.platform=linux/arm64"

All went smoothly

Then I typed:

docker compose -f pwd.yml up -d

and all went without errors.
So I have:

$ sudo docker ps
CONTAINER ID   IMAGE                             COMMAND                  CREATED        STATUS                          PORTS                                                    NAMES
27ee36b8f328   frappe/erpnext:latest             "nginx-entrypoint.sh"    15 hours ago   Restarting (1) 52 seconds ago                                                            frappe_docker-code-frontend-1
fc705c7358e9   frappe/erpnext:latest             "node /home/serverSD…"   15 hours ago   Restarting (1) 47 seconds ago                                                            frappe_docker-code-websocket-1
fb10119c9bc7   frappe/erpnext:latest             "bash -c 'wait-for-i…"   15 hours ago   Up About a minute                                                                        frappe_docker-code-create-site-1
ac5c6794e357   frappe/erpnext:latest             "bench worker --queu…"   15 hours ago   Restarting (1) 20 seconds ago                                                            frappe_docker-code-queue-short-1
d6506292378a   frappe/erpnext:latest             "/home/frappe/frappe…"   15 hours ago   Up About a minute                                                                        frappe_docker-code-backend-1
6a6c104eaa37   frappe/erpnext:latest             "bench schedule"         15 hours ago   Up 8 hours                                                                               frappe_docker-code-scheduler-1
f82105c9db2a   frappe/erpnext:latest             "bench worker --queu…"   15 hours ago   Restarting (1) 20 seconds ago                                                            frappe_docker-code-queue-long-1
106139cfbe29   redis:6.2-alpine                  "docker-entrypoint.s…"   16 hours ago   Up About a minute               6379/tcp                                                 frappe_docker-code-redis-cache-1
37d308c96c9a   mariadb:10.6                      "docker-entrypoint.s…"   16 hours ago   Up About a minute (healthy)     3306/tcp                                                 frappe_docker-code-db-1
abeae22cc441   redis:6.2-alpine                  "docker-entrypoint.s…"   16 hours ago   Up About a minute               6379/tcp                                                 frappe_docker-code-redis-queue-1


Practically there are some containers that are failing so restart continuously.
I investigated this issue with the following checking of logs, for instance about $ sudo docker logs frappe_docker-code-queue-long-1 , and it returns this

So as you can see the backend it is looking to the port 3306 instead of 3307 as set on the env file, queue-long is looking for the default address 127.0.0.1 and not 192.168.1.104

I’ve seen that only the frontend is connecting to 8081 as requested.
Where is the error on the variable setup in the files?

Why not use the “overrides” compose files.

The 3306 is an internal port that will be accessed within the docker network only. Nothing to worry about conflicting with another DB server on the machine.

Change that port to 3306 and try again.
Also, in configurator service in pwd.yml you have:

…
wait-for-it -t 120 db:8982;
…

Why the port is 8982?

Also, you are exposing 8081 to Apache… how are you handling that in Apache conf?

You need to change the “configurator” service to set the variables as per you hosts/ports.

Thanks for your reply

[quote=“knimer, post:2, topic:142489”]
Why not use the “overrides” compose files.
[/quote] It’s a bit complecated to use without a clear guide on how to exactly use them

Thus to correct my setup I should:

  • List set DB_PORT=3306 in the env file

  • List change the value for the line: “wait-for-it -t 120 db:8982;” Should it become “wait-for-it -t 120 db:${DB_PORT};” or “wait-for-it -t 120 db:8081;”?

Yes, about Apache in conf file I set the port on 8081 and not 8080 because busy

By the way, the line “wait-for-it -t 120 db:8982;” is not in the configurator service but in the create-site service declaration in the pwd.yml file

The error suggests that common_site_config.json is not populated. It uses default hosts and ports if not set in common_site_config.json. configurator service sets common_site_config.json.

Share your common_site_config.json

Irrelevant to where it is declared, this is wrong. This should be the DB port.

I cannot find this file common_site_config.json anywhere.
I read it is created after the installation and I don’t know where I should look at. Where is it?
Please consider that at the address /home/serverDCF/ERPNext/runningApps/frappe-bench/ there is nothing . Is it expected?

Check in the “frappe-bench/sites” folder.

As reported there is nothing in th folder /home/serverDCF/ERPNext/runningApps/frappe-bench/
Thus I created the two folders sites and logs inside, but nothing is created in /home/serverDCF/ERPNext/runningApps/frappe-bench/sites or /home/serverDCF/ERPNext/runningApps/frappe-bench/logs. Practically the system does not create any file common_site_config.json
How to get where is the problem?

I’m still in this situation:

$ sudo docker ps --no-trunc
CONTAINER ID                                                       IMAGE                             COMMAND                                                                           CREATED        STATUS                          PORTS                                                    NAMES
8210486f19f4620ec496c8e8a481346762d331056685f059c5468dd305b02fea   frappe/erpnext:latest             "nginx-entrypoint.sh"                                                             25 hours ago   Restarting (1) 40 seconds ago                                                            frappe_docker-code-frontend-1
8a1020d8c526301ae88ef0b68255c75f9c41425e500038d82f5b21428ed362eb   frappe/erpnext:latest             "node /home/serverDCF/ERPNext/runningApps/frappe-bench/apps/frappe/socketio.js"   25 hours ago   Restarting (1) 42 seconds ago                                                            frappe_docker-code-websocket-1
18bc1e050b46556bae55e687f8386155c56bff8f3d97125a5f7bd9da4fa22b9e   frappe/erpnext:latest             "bench worker --queue short,default"                                              25 hours ago   Up 1 second                                                                              frappe_docker-code-queue-short-1
7683a7927286e578fb2180ebfbe68426c4563dfbbe4bb1b624f02f371330b6dd   frappe/erpnext:latest             "bench worker --queue long,default,short"                                         25 hours ago   Restarting (1) 2 seconds ago                                                             frappe_docker-code-queue-long-1
821a71a3f96209da34b0530e69750a569a1c768e64014cf001dfab02f344daf4   frappe/erpnext:latest             "bench schedule"                                                                  25 hours ago   Up 12 hours                                                                              frappe_docker-code-scheduler-1

the point is that in the folder /home/serverDCF/ERPNext/runningApps/frappe-bench/apps/frappe/ there is nothing.
By terminal I got this:

~/ERPNext/runningApps/frappe-bench/logs $ ls -a
.  ..

Therefore there should be something that blocks the system to work correctly, generates the files and folder to make the correct setup.

Is there someone that can help with this?
You can fully replicate the installation, just copy and paste the full content of the pwd.yml and env files. As explained before, I corrected the DB_PORT in the env file on 3306. And in the create-site service declaration in the pwd.yml file, I put “wait-for-it -t 120 db:${DB_PORT};”
So what’s the problem that I’m encountering and how can I solve it?

Your setup is custom. You’ll need to figure it out on your own. There is no such mount point used in frappe_docker. (~/ERPNext/runningApps not used) You haven’t shared your custom yamls that specifies you’re using bind mount. For bind mount you need to fix the permission to 1000:1000 uid:gid. Also only ~/frappe-bench/sites need to be mounted not the whole ~/frappe-bench!

Hello,

In addition to @revant_one comments.

Notice that your DB container is not up at all. Everything starts with the DB, any other service will fail to start directly or indirectly.

Also, the mounts you did in the compose file:
sites:/home/serverDCF/ERPNext/runningApps/frappe-bench/sites

With this you are changing the “inside the container” path. Why do you need to do that? Or this is only a mistake and it should be:

/home/serverDCF/ERPNext/runningApps/frappe-bench/sites:/home/frappe/frappe-bench/sites

???

For the frontend service, are you sure about this?

ports:
      - ${HTTP_PUBLISH_PORT}:80

Why port 80 inside the container??

Also, check this in .env:

UPSTREAM_REAL_IP_ADDRESS=192.168.1.104

Can you change it to 127.0.0.1 and try??

Please check and get back here. Please answer all @revant_one questions. These are very important questions to answer.

Also, make sure you start fresh and all previous volumes are removed before going before docker compose up (becareful not to delete important stuff - backup before if needed).

1 Like