Installing the Docker image on a local machine without Letsencrypt so we can access it with http://localhost

Hello

Is it possible to install the Docker image on a standalone machine without https?

I don’t have much experience when it comes to Docker. I want to install ERPNext on a local machine so that a single clerk can use it for accounting etc. There’s no need for https or networking. All I want is an isolated machine with ERPNext on it.

I’ve read the documentation on the Docker install pages GitHub - frappe/frappe_docker: Docker images for production and development setups of the Frappe framework and ERPNext frappe_docker/images-and-compose-files.md at main · frappe/frappe_docker · GitHub
frappe_docker/setup-options.md at main · frappe/frappe_docker · GitHub

The below steps are from the instructions on docker localhost - #2 by revant_one

I’ve scripted the steps so I can replay and post my steps here:

sudo apt install docker docker-compose git
docker version #20.10.7
docker-compose version #2.2.2
git version #2.25.1

I then prepare the directory:

sProj=erp2
sDir=/home/ep/docker/${sProj}/
mkdir --parents ${sDir}
cd ${sDir}

I then pull the git repo

git clone https://github.com/frappe/frappe_docker
cd frappe_docker
cp example.env .env

I then edit the .env file. Note that I do not delimit the values in backticks. Also ‘erp2’ is the literal value of ${sProj}.

FRAPPE_SITE_NAME_HEADER=erp2.localhost

I then build the ${sProj}-docker-compose.yml file in ${sDir}

docker-compose -f compose.yaml -f overrides/compose.erpnext.yaml -f overrides/compose.mariadb.yaml -f overrides/compose.redis.yaml -f overrides/compose.noproxy.yaml config > ${sProj}-docker-compose.yml

I then start the container using the above yml

docker-compose --project-name ${sProj} -f ${sProj}-docker-compose.yml up -d

Once successful, I then check the log

docker logs ${sProj}-frontend-1 -f

I then create a site

docker-compose --project-name ${sProj} exec backend bench new-site ${sProj}.localhost --mariadb-root-password 123 --admin-password pw01

Finally I try to access the app

 chromium ${sProj}.localhost

Screenshot%20from%202022-03-24%2009-05-15

3 Likes

can you try to reach http://erp2.localhost:8080

If compose.noproxy.yaml is used in overrides then it will publish port 8080

You can change it to any port you wish. Port 8080 is used because some systems only allow root user to publish ports less than 1000.

1 Like

Ah, as always @revant_one, you come to the rescue!

chromium http://${sProj}.localhost:8080

Thanks so much for all your contributions, big and small, they make such a difference to our experience with ERPNext. :+1:

1 Like

Once I log on as Administrator, I notice that none of the ERPNext modules are present, only the Frappe Core modules.

Surely the ERPNext app is installed when I add the following override to the docker-compose.

-f overrides/compose.erpnext.yaml

How do I now activate the ERPNext modules?

I tried to install ERPNext again but it says I cannot install it once the Wizard has run.

docker-compose --project-name ${sProj} exec backend bench --site ${sProj}.localhost install-app erpnext

So it must be present but just not showing?

at this point where you created the site you need to add --install-app erpnext.

or install ERPNext first thing before running wizard.

2 Likes

Thanks for taking the effort to format and document the post so well! This kind of community etiquette is rare. Such posts motivate to answer. The logs are shared even before asking. The first post clears everything, second post answers! Saves everyone’s time. Future readers will be happy. Community will benefit.

Rare to find this behaviour. Such posts keep the community forum worth the search.

5 Likes

After some refactoring changes in docker_frappe, I needed to do the following to get a working environment:

# Clone repo and setup .env, setting FRAPPE_SITE_NAME_HEADER=erpnext.localhost
git clone  https://github.com/frappe/frappe_docker
cd frappe_docker/
sed 's/FRAPPE_SITE_NAME_HEADER.*/FRAPPE_SITE_NAME_HEADER=erpnext.localhost/' example.env > .env

# Create combined docker-compose.yml
docker-compose -f compose.yaml -f overrides/compose.mariadb.yaml -f overrides/compose.redis.yaml -f overrides/compose.noproxy.yaml config > erpnext-docker-compose.yml

# Pull images, create and start containers
docker-compose --project-name erpnext -f erpnext-docker-compose.yml up -d

# Create new site
docker-compose --project-name erpnext exec backend bench new-site erpnext.localhost --mariadb-root-password 123 --admin-password pw01

# Install erpnext app
docker-compose --project-name erpnext exec backend bench --site erpnext.localhost install-app erpnext

Login by opening http://erpnext.localhost:8080 in your browser:
Username: Administrator
Password: pw01

It should start the ERPnext setup wizard

2 Likes

Just omitting the multi-bench-ssl override from the Single Server Example and adding an entry to the hosts file seemed to work for me