ERPNext Foundation ERPNext Cloud User Manual Blog Discuss Frappé* Donate

ERPNext Docker Image as an alternative to Official ERPNext Docker Repo


#21

Was about to ask same :blush:


#22

Did you guys mean update to kubernetes/helm solutions or Docker solutions? :slightly_smiling_face:


#23

Hi @pipech

I was referring to Docker :blush:


#24

For docker it’s gets constantly update.

New image will get build automatically (by Travis) every week, it will perform very basic test (It just test that image can run and when tried to access to website it return 200 HTTP status code) before push to docker hub.

Currently there’re 3 important branch on frappe. So now on latest tag we’ll have 4 tags.

v10.x.x (v10) - v10 [python2]

  • v10-py2-latest

Master (mas) - v11 [python2, python3]

  • mas-py2-latest
  • mas-py3-latest

Develop (dev) - v12 [python3]

  • dev-py3-latest

Image size are around 2.75GB

And there are 3 set-up as mention before trial, develop and production

Cheers!


#25

Personally (I must admit a bit of bias, I’m working on bringing the official image up to par), I’m not sure what you mean. Part of containerizing is making every container do only what it needs to do, and not more than that.

Plus, the (real) reason for this, is probably because bench runs three instances of redis.


#26

Hi @pipech

What I actually need is a bit of clarification about the tags. Is mas-py3-latest same as 11.1.11-py3 and will they both work?


#27

They both work. Latest tag will be the same image with most recent tag version.

ie. For now mas-py3-latest tag is same image with 11.1.11-py3
if tag 11.1.12-py3 is added, mas-py3-latest will change and be same image with 11.1.12-py3
but tag 11.1.11-py3 will stay the same.


#28

Excellent! That was my thought too but wanted to be sure

Thanks for this great work :+1:t3:


#29

Hi @pipech

I tried installing the latest version (master branch) last week and encountered the error below:

Traceback (most recent call last):
  File "/usr/local/bin/bench", line 11, in <module>
    load_entry_point('bench', 'console_scripts', 'bench')()
  File "/home/frappe/.bench/bench/cli.py", line 40, in cli
    bench_command()
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 722, in __call__
    return self.main(*args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 697, in main
    rv = self.invoke(ctx)
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 1066, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 895, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 535, in invoke
    return callback(*args, **kwargs)
  File "/home/frappe/.bench/bench/commands/update.py", line 128, in switch_to_branch
    switch_to_branch(branch=branch, apps=list(apps), upgrade=upgrade)
  File "/home/frappe/.bench/bench/app.py", line 402, in switch_to_branch
    switch_branch(branch, apps=apps, bench_path=bench_path, upgrade=upgrade)
  File "/home/frappe/.bench/bench/app.py", line 395, in switch_branch
    reload(utils)
UnboundLocalError: local variable 'reload' referenced before assignment

The site was however still installed successfully but it was V10 (ERPNext: v10.1.73 / Frappe Framework: v10.1.65) instead of V11!

Any idea what could cause this?

Also, I noticed that commands like bench update --patch don’t work. How do we get around issues that may occur due to differences in database schema?

Thanks


#30

Hi, @wale

What command did you run before this error occur?


Could you copy Traceback of bench update error and place it here or open issues on github?


I’ve just pull and run pipech/erpnext-docker-debian:mas-py3-latest and it is version ERPNext: v11.1.13 (master), Frappe Framework: v11.1.13 (master).

I think you might use wrong image tags. What exactly image tag did you use?


You shouldn’t have to install ERPNext since image is come with pre-install Bench, Frappe and ERPNext.

Best regards


#31

can i change the version to v7 and install a custom app ?


#32

@pipech

Have you worked out a way to setup Let’s Encrypt on the production setup so that it could truely be used in a production environment?

I have been looking through your files and do not see a separate container for this?
How are you allowing a security certificate to be generated for a production site?

I found this in your fist post, but could not find (or got myself lost) in your github listing.

Update specifically I an interested in using the v10 docker files to establish a production server with security cert.

Thanks in advance…

BKM


#33

I’m not sure if it will works with version 7, you could config Dockerfile to see if it works.

It use Traefik image to setup HTTPS.
Setting up HTTPS you’ll have to config 2 file.

  1. Change email for acme in production_setup/conf/traefik-conf/traefik.toml

  2. Change Traefik frontend rules (Domain) in production_setup/prd.yml

But you should follow the whole instruction here.
Production Setup Instruction

Best regards


#34

Thanks for the great work you have put up on this project @pipech

I have a production version of the latest v10 running on one of my testing cloud servers and it appears to run smoothly. I only have a few questions.

  • Where is the actual MariaDB database stored? I could not find this when I went digging around in the dockerfiles.

The database file seems like it might be in a container somewhere because I do not see any place where you would have allowed it to be persistent.

  • Would it be possible to ‘bind’ the actual database file to a real hard drive location so that it can be easily backed up and move to other locations for safe keeping?

I currently use installs directly on VPS servers and I use ‘mysqldump’ command to run a complete database backup every hour. Those backups are then moved to alternate servers so that I can perform a rapid recovery in the event of a catastrophic primary server failure.

I would like to be able to do the same with a containerized ERPNext but the database file would need to be kept on the underlying server hardware to make this process easier to implement.

  • What modification would I have to make to your file for the mariadb image to get the database to bind to the local server hard drive?

This docker implementation is new to me, but it shows a great deal of promise for stability.

Thanks,

BKM


#35

Oh yeah…

And one more question.

In the event the docker server suffers a power cycle, what is used to make sure the docker platform and the related containers are reloaded and restarted?

BKM


#36

MariaDB database stored in docker volumes name mariadb-data-volumes which will locate in /var/lib/docker/volumes .


You could use bind-mounts .


Change this mariadb-data-volumes:/var/lib/mysql to /your/folder/location:/var/lib/mysql .

volumes:
   - /your/folder/location:/var/lib/mysql

Or don’t change that and bind new volume then use mysqldump dump to that folder.


You use systemd to start docker automatically by run this command sudo systemctl enable docker .


PS. I have backup utilities which will backup all persistent data including docker config, but it will make server unaccessible for 5-10 minutes. (You could use this tools to move your server to different host or recovery from major server failure.)