There is docker environment for development with bench. Refer this README
People from community are using it for quickly bootstrapping development setup.
One such attempt, Chinmay started with a production installation script called frappe-installer.
Makefile or shell script I don’t mind anything. I hope it’ll only help new comers.
Experts can already use and understand things with or without any abstraction.
Just be careful of adding complexity, may make it difficult for new users to report underlying errors.
As I said before, for development environment bench command is used. Today we even got a PR that allows one environment to host 5 benches.
Reasons for not using bench in production docker:
Immutability. All state is in database and volumes only. Adding custom app to container on the fly is not desirable in production because it creates state in container which will be lost.
bench image itself adds 1GB of dependencies. Frappe+ERPNext adds ~1.4GB more.
bench does a lot of development tooling as well.
Each command added as script is auto-tested daily. Ensures stability on production.
Here are the 2 basic goals and potential solutions,
Quick Local setup:
Setup env file, run docker-compose up and visit http://site-from-env-file.localhost
single docker-compose file is required with all redis, mariadb, frappe/erpnext services and port 80 published on host machine
Someone I interacted with on issue used it on LAN/WAN setup with self hosted internal DNS server. e.g. http://site-from-env-file.local-machine-01 was accessible within from LAN.
local setup is required for local api or ui development that needs to connect to erpnext server.
Quick production setup:
Setup env file, run docker-compose up and visit http://site-from-env-file.com
single docker-compose file is required with all redis, mariadb, frappe/erpnext services and some way to manage Letsencrypt.
Problem with current production setup on docker:
VERSION is not locked. It’s locked to either major version or edge.
VERSION can be separated into FRAPPE_VERSION and ERPNEXT_VERSION to be specific.
Way to achieve new site creation on first run:
docker-compose can have one run-once service to execute the new command to create a site.
It will anyway fail on additional runs as it will try to re-create same site again.
I’ve indeed, seen it, and tried it, and It’s just great a simple docker-compose up -d and you’re up and running. But when I meant something easy for developers, I mean something easy to also deploy, not only for develop. Therefore I agree with your proposal of a simple docker-compose command for production as well.
I would argue that having 3 files for a compose loses you a lot of flexibility even if avoiding repeating once self, since now running docker-compose {logs, dow, build, pull, ...} you have to specify 3 files and the project name.
I’m working on a compose file that uses the awesome linuxserver/letsencrypt container which is nginx and letsencrypt in one container with certifical renewal.
Also looking to modify the entrypoint in the default worker, to check if the app is not installed proceed and install into the database. Still I’m not very knowledgable of many things, but I’ll share what I accomplish, and if good enough will make a PR.
Hi!, there is a wrapper to integrate MySql to PostgresSQL, may this feature work as a bridge whilst the PostreSQL-ERPNext support is in process. The link is right here: mysql_fdw: MySQL FDW for PostgreSQL 9.3+ / PostgreSQL Extension Network
We haven’t tested yet, as soon we have an insight or if someone else makes it work please share here. Regards from Mexico! Stay healthy!!!