Try ERPNext Buy Support Partners Foundation

How to get started with the official Docker image?

@vishal

Here’s my experience so far with trying to use the official docker image.
(Note: it’s my first time using Docker in over 3 years)

I ask some questions at the end.


I read the announcement by @revant_one : Official Docker Updates 2020

I follow the link to the Official DockerHub Listing for ERPNext-NGinx

There’s no guide or instructions at all, all I see is docker pull frappe/erpnext-nginx

I try it …

erpdev@erpdck:~$ docker --version
Docker version 19.03.8, build afacb8b7f0

erpdev@erpdck:~$ docker pull frappe/erpnext-nginx
Using default tag: latest
Error response from daemon: manifest for frappe/erpnext-nginx:latest not found: manifest unknown: manifest unknown

erpdev@erpdck:~$

… hmmm. Ok, was that naive?

I’ll work from the frappe: frappe_docker README

Steps :

  1. “To get started, copy the existing env-example file to .env inside the installation directory”
  2. Edit as required
  3. Run the first docker-compose command …
  4. (not mentioned!) Install docker-compose
  5. Run the first docker-compose command …
  6. (not mentioned!) move .env to outside the installation directory
  7. Run the first docker-compose command …
  8. Edit VERSION in the .env file to try a different release number
  9. Run the first docker-compose command …
  10. Edit VERSION in the .env file to try a different release number
  11. Run the first docker-compose command …
  12. Edit VERSION in the .env file to try a git branch name
  13. Run the first docker-compose command …
  14. Run the second docker-compose command …
  15. Wonder what to do next…

Questions:-
Where can I find installation instructions for the official Docker image?
Where can I find instructions for using the official Docker image for developing an ERPNext module without having to use VSCode?
How can I get a command line inside the docker container?

Not required for new version of docker-compose. More: docker-compose does not recognize variables from .env file

Please update the readme. We’ll merge anything that is good.

For production it uses three images.

Deploy Production Images

Development - Non VS Code Section
For development there is one image.

Container must be running, use command,

docker exec -it ...

check,

docker exec --help

Brief Steps

Knowledge about docker is essential. (uid/gid, bind mounts, volume mounts, permissions, images, containers, CMD, Entrypoint script, general devop docker knowhow)

These steps are basic introduction to docker-compose. Copy-paste without any understanding not recommended. Ask questions for each step and understand scientifically what is happening. Check github issues, people who know docker are using their own docker-compose with traefik instead of nginx.

Prerequisites

  1. install docker, docker-compose
  2. Use non-root user for all the steps
  3. non-root user should be part of docker group, ensures docker commands don’t require sudo
  4. non-root user’s uid = 1000 and gid = 1000. Generally first user has 1000 uid/gid

Deploy locally.

(Production setup is different, it doesn’t publish ports on host)

  1. clone frappe_docker repo
  2. copy env-example to installation directory (new docker-compose) or copy to frappe_docker/ directory in case you’re on ubuntu 18.04 and using old docker-compose
  3. execute the docker-compose commands to “start services” and to “publish ports” https://github.com/frappe/frappe_docker#local-deployment-for-testing

Create Site and site operations

create new site https://github.com/frappe/frappe_docker#setup-new-sites

common mistake. SITE_NAME MUST end with .localhost for trying deployments locally, e.g. test.localhost

once site is created access it at http://test.localhost

Important

I am not the best README writer. If anyone can improve README for beginners, please help. All current README writers are advance docker users.

2 Likes

@revant_one

Ok. Now I am embarrassed.

I had not realized the docker set up was so complicated. It’s more than I can face right now. It’s also much more than my ultimate purposes require. My entire setup will never have more than a dozen internal users and under a hundred remote, portal only users.

I was running into yet another terribly exasperating install script bug and wasting yet more days trying to solve it, so I thought maybe the Docker option is a way out of the quagmire. Anyway …

I am sure the title I chose for the query and your detailed getting started clarifications will benefit someone in the future.

I greatly appreciate the effort you put into that.

Trying to making it simple.

Definitely cleaner and less intimidating.

Thanks

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.