ERPNext docker discussion

I crafted the erpaas app quickly as I was discovering and learning ERPNext a few weeks ago, so it is not complete and definitely not tested and not production readyh. It is currently running the site https://intego.rw (also not for production so far) with GitHub - africlouds/intego_rw . I hope it will get better with time

@RWEMA_Aimable thx i’ve tried to install on last V7 development version and getting error while openings erpnext service page…also not displaying the app on desk

@RWEMA_Aimable well anyway thanks for making it and I hope I can help to make it better. You have some nice extensions that you have started…

any plans to separate any of the multiple services building ERPNext?
As far as I could follow this is not possible entirely (due to how ERPNext is glued together as I understand)

But for example separating | MariaDB | nginx | all the rest | … might be a start.

I think that the biggest issue is that you only provide one way to install bench with your setup script.

I’m not a big fan of this way as I like to know what I install and why.

Maybe, if you provide some manual setup instructions:

  • install mariadb
  • install reddis
  • install Python dependencies (in a virtualenv)
  • install bench (still in a virtualenv)
  • add some settings to hit mariadb and reddis
  • start using it

I didn’t dig at all in your code base so I’m not aware if it’s possible or not. But I’m clearly not trying to install it as it’s require superusers privileges, but using Mac OS with homebrew, I almost never have to use sudo to install anything.

I know that this thread is about Docker for ERPNext, but IMHO bench is a pain to install and that’s the entrypoint to start using and building with ERPNext.

2 Likes

Howdy All. Our company recently discovered ERPNext and is evaluating it for use in house. We have our entire infrastructure built around Docker and Amazon ECS. My first tasks are to make ERPNext work in a Docker environment before we can use it.

I have taken a look at the following public Docker hub images:

https://hub.docker.com/r/davidgu/erpnext/
https://hub.docker.com/r/raman/erpnext/
https://hub.docker.com/r/donysukardi/erpnext/

The first two essentially treat the container as if it were a VM. donysukardi’s repo started an attempt to separate the components into individual containers. My preference is for the latter, so I’ve taken that as my starting point and submit a PR to donysukardi. He may not be maintaining his repo any longer though.

That said, I’ve got an experimental build working with ERPNext running on 11 docker containers. I’m very, very new to ERPNext–so I may be missing something–but it seems like it is working well.

I was hoping the community could help me validate it and continue the work.

Here is my fork:

Anyone with a Docker install should be able to get this running in a couple minutes. If you have some time please take a look and give it a shot.

Right now all the secrets are hard coded, so that needs to be changed ASAP.

What do you all think otherwise?

Thanks for all the previous work, both with ERPNext on Docker and ERPNext in general.

6 Likes

Right now all the secrets are hard coded, so that needs to be changed ASAP

If I recall previous comments in regards to this correctly this isn’t something which the core team has on it’s list of priorities but would be open to accept PR’s about

In that case I think for this container image what I’d do is have the startup script handle writing the site_config.json based on ENV vars. Then no modification would be needed in Frappe.

Of course it would be way better if Frappe read directly from ENV vars rather than config files. So +1 for that still.

Thanks!

@ianneub just clarifying … testing should be done using your docker-compose branch, not ‘master’, correct?

EDIT git clone --branch docker-compose GitHub - ianneub/docker-frappe: Dockerized image of Frappe

That is correct.

IMAGE_NAME=donysukardi/frappe:stable ./hooks/build . is failing with the following errors on Ubuntu 16.04 and docker-compose version 1.7.0 and Docker version 1.11.0

Any hint?

/usr/include/python2.7 -c psutil/_psutil_linux.c -o build/temp.linux-x86_64-2.7/psutil/_psutil_linux.o
    psutil/_psutil_linux.c:19:27: fatal error: linux/version.h: No such file or directory
    compilation terminated.
    error: command 'gcc' failed with exit status 1
    
    ----------------------------------------
Command "/usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-7_dXAL/psutil/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-8n2pXk-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-7_dXAL/psutil/
The command '/bin/sh -c git clone -b $BENCH_BRANCH --depth 1 https://github.com/$FRAPPE_USER/bench bench-repo &&     sudo pip install -e /home/$FRAPPE_USER/bench-repo --no-cache-dir &&     mkdir -p frappe-bench && cd frappe-bench &&     mkdir -p apps logs sites/localhost config &&     bench setup env &&     sudo bench setup sudoers $FRAPPE_USER &&     bench setup socketio &&     bench get-app frappe https://github.com/frappe/frappe --branch $FRAPPE_BRANCH' returned a non-zero code: 1

Did not realize the bench README was not clear.

Fixed now, please share your comments!

cc @pdvyas

@RWEMA_Aimable did you switch to the docker-compose branch? Sorry I didn’t make that clear

You could try AthenaPDF
https://github.com/arachnys/athenapdf

as drop in replacement for wkhtmltopdf, its already powered by docker and you will avoid lots of crazy problems that will be caused by wkhtmltopdf. just a suggestion

2 Likes

Same error on develop branch

@RWEMA_Aimable

it’s the docker-compose branch you need to use (or is that what you meant when you said ‘develop branch’?)

@ganas athenas looks nice. Do you want to try it out for frappe?

I realize this is primarily a developers’ discussion, so I hope this comment is not out of place, but speaking from an end-user perspective, here’s why a single docker-container install is preferable for me even over the standard easy install: The easy install keeps failing for me (on Debian 8 Jessie). After a previous install got corrupted, I have lost 3 days of productivity time just trying to get ERPNext running again without success. I have already wiped my OS twice.

If an official turnkey dockerfile installation is available for a production environment where I only have to update some passwords and 1-2-3 I’m up and running again after something goes wrong, it’s a major plus for a non-developer like me.

Also much more of a user then developer here.
The container world promotes very much groups of single service containers funtioning together over all-in-one containers

I think the main advantages of such come to play really once you have i.e. one db container that serves databases for more then 1 (even very many) ERPNext containers. On a one site deployment that might not be so relevant.

From my perspective being docker ready would also attract more companies that provide ERPNext services (which may incl hosting) which will bring a lot of know how and development power to the whole scene I believe (@ianneub 's company may be an example for such)

Having both options would be good