ERPNext docker discussion

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

Thanks @ganas. I tested this out, but actually it is not as simple as it sounds. Because I am putting Frappe inside a Docker container it is IMHO bad form to have that container try to create a new Docker container. This requires giving the container read/write permissions to the Docker daemon running on the host. An attacker could potentially run any container they wanted and have full root access to the host system in doing so.

That said, I could still use AthenaPDF binaries from inside the container, without using their native Docker packaging.

You can package it as NPM or Electron app, and use it. athenapdf_NPM

@rmehta i’ll try it on frappe using NPM build and I’ll let you know

1 Like

OK thanks, I got the images built now, was using develop instead of docker-compose branch. Follow up discussion on this thread:

https://discuss.frappe.io/t/problems-with-my-docker-image/16259/2?u=rwema_aimable

1 Like

You really did an awesome job, thank you.

This way I can test ERPNext without install anything on my machine.

1 Like

And thanks to you too, those are the instructions I wanted to start digging into the development process.

@RWEMA_Aimable

getting an Sorry, you don't have access to that topic! error following your link, but would like to take a look at it. As I neither can find it by searching the forum …

can you look whether you can dig it back out somehow or post the relevant content in this topic here?

@ganas @ianneub @rmehta … isn’t that more a discussion about how to make ERPNext better (in regards to creating pdf’s from html) and not really related to the topic of getting it to run in a dockerized setup? If so, I’d suggest to put that in a different topic