ERPNext.com Frappe Cloud Support Partners Foundation Frappe School

ERPNext Docker Image as an alternative to Official ERPNext Docker Repo

what is the admin password or how can i get it?

It’s “12345” or “admin” depend on setup, for production setup you will have to create new site which you will be ask to enter admin password.

I know It’s a very late comment. But I don’t think that’s precisely the Idea of docker. Yes it offers to isolate things like that. Otherwise let’s just spin up a worker for every task is needed. Is just in my opinion overkill. I’m not an expert on Docker. But I have deployed many applications, and It tends to be pretty easy.

The frappe/frappe_docker repo is honestly a nightmare for what Docker represents. It spins I think 11 containers, and you have 3 docker-compose files. Go check any other ERP and you would see one simple compose file.

Odoo, Tryton, a simple docker-compose file and voila.

The workers execute the tasks the bench usually does, but using some python scripts. Like creating a new site, installing apps, etc. So what is the bench for and all It’s 1600 commits to date. If you’re not going to use it when deploying in docker?

Overall I think it’s very important for the product to be easily deployed, In opens the doors to new people. And drives adoption up.

If official Docker needs to be improved, please send improvements as PRs

PRs are actively reviewed and merged

I made it decoupled images only to use it on kubernetes.

I think only few large enterprises from community and I’m using docker for kubernetes. Large enterprises have their own images on their own repos.

I had my own repo. I merged it to core because some enthusiasts collaborated with me.

1 Like

The work done on docker is elegant if one understands Kubernetes. It is not just about deploying on docker because it would be no better than deploying on a server machine. It is about having Kubernetes take care of the load by deploying just the component that is overworked or got bogged down. You don’t deploy mariadb with frappe in one container otherwise you deploy two separate databases. What the Erpnext has done with this docker and kubernetes setup is to properly separate the different parts of the monolith into correct microservices. This makes Erpnext much more powerful compared to Odoo or Tryton and enables it to compete on the enterprise level

1 Like

I must admit, I do not understand Kubernetes, and I can see that separating the images gives you more flexibility. I only argue that well making it easier to install for developers, not devops people should be very useful!

Great work with it. I’ll work on it and will send PRs, maybe you consider them good. I was thinking of a simple Makefile. That instead of calling docker compose with multiple files, and then having to lookup the command to spin it down.

I’m not an expert, but something like this might make things easier.

# Start frappe and initialize the site in the env variable
make erpnext-up init
# Bring it down
make erpnext-down

I would like to ask, why bench is not used on the docker containers, and instead the use of the python scripts? I’m trying to familiarize with the architecture.

I have run : docker run -d -p 8000:8000 -p 9000:9000 pipech/erpnext-docker-debian:mas-py2-latest
And it has picked on my localhost
How do I login?

In this case, docker may not be the solution. It is better to install directly to the machine using Easy Install. However you will have to monitor the status of tge machine. Kubernetes enables you to deploy applications and monitors the health of the deployment. If it detects that there are too many connections, it will spin up another instance of the application using docker and do load balance. When it detects few connections it will spin down the excess instances. This way you dont have to get a big server with excess capacity. You will just need docker images waitingbto be spin up or down based on demand. ERPNext is designed as a monolith with the interlocked connections to mariadb database, redis, backgound workers, bench for development. It was designed for the 2010 era. In 2020, Computing is not needed to be server based but cloud based where computing power can be bought as a utility from cloud providers. This is where Kubernetes and docker shines. This work on ERPNext allows it to be ready for the 2020 era. There is still a lot of room for improvement. But it is a great start to push ERPNext in the DevOps arena.

1 Like

Hey all,
I am new and experiencing some difficulties with getting erpnext running with docker-compose. Since this thread is very active I didnt open a new one, hope thats okay.

My setup:
Win 10, docker-compose 1.25.5

I am following https://github.com/frappe/frappe_docker and want to start the local deployment for testing, i.e. run expose on localhost.

My .env:
    VERSION=version-12 (I also tried edge)
    MARIADB_HOST=mariadb
    MYSQL_ROOT_PASSWORD=admin
    SITES=test.localhost
    LETSENCRYPT_EMAIL=<my_mail>

I can docker-compose up all the containers according to the readme:

docker-compose \
    --project-name <project-name> \
    -f installation/docker-compose-common.yml \
    -f installation/docker-compose-erpnext.yml \
    -f installation/erpnext-publish.yml \
    up -d

But when I open localhost:80 in browser I get the sorry we will be back soon error page. I get no errors from docker-compose -f … logs,
but: docker logs erpnext-nginx_1 gives me:

error] 29#29: *27 upstream prematurely closed connection  
while reading response header from upstream, client:
172.18.0.1, server: $http_host, request: "GET / HTTP/1.1",
upstream: "http://172.18.0.5:8000/", host: "127.0.0.1"
172.18.0.1 - - [11/Jun/2020:18:49:12 +0000] "GET / HTTP/1.1"
502 5444 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64;
rv:77.0) Gecko/20100101 Firefox/77.0" "-"

172.18.0.5:8000 is the python worker erpnext-python_1 and a curl -v 172.18.0.5:8000 from one of the containers i get an empty reply.

Am i missing something? Thanks in advance

This thread is not for official docker.

It is for alternative images.

Please start new thread or create new issue with label question https://github.com/frappe/frappe_docker/issues

Thank you, I opened a new question at: https://github.com/frappe/frappe_docker/issues/257

It’s “12345” or “admin” depend on setup, for production setup

Do you think it might be an idea to add environment variable so that administrators can set a more sensible and secure password?

Could it instead use the init script to output an initial randomly generated password to logs and CLI

Thanks for creating a thing. I think it may help the people who asked about Heroku :ok_hand: .

Yes, you should use bench new-site command and set a new password for production setup but for trial or development setup I think security won’t matter.

Even if you didn’t plan to spin up multiple container or production setup if you want secure password you could use bench set-admin-password.

You should try different version, try this command.

docker run -d -p 8000:8000 -p 9000:9000 pipech/erpnext-docker-debian:v12-py3-latest

After that go to web browser and go to localhost:8000 to access ERPNext

I can’t find a button to update the post but Official ERPNext Docker have becoming active and improved a lot since I create this post.

If you won’t mind its complexity it’s a great way to deploy ERPNext for large enterprise.

I just wanted to clear that out. :grinning:

Made yet another attempt to simplify docs for simple environments. https://github.com/frappe/frappe_docker/blob/develop/docs/single-bench.md

Hope to help self-hosting small enterprises.

is there any particular reason that this document is only available in the develop branch? In other words, do you need to use the develop branch in order to run this?

I made the post into wiki. Check if you can update it.