earthians / marley

Open Source Health Information System
https://frappehealth.com
GNU General Public License v3.0
298 stars 232 forks source link

Create a Frappe Health Docker image #468

Open neutralboy opened 2 months ago

neutralboy commented 2 months ago

Is your feature request related to a problem? Please describe.

ERPNext has a docker image but Frappe Health does not, with ERPNext moving to a single docker image we have a chance to create a single Frappe Health image that has frappe, erpnext and health apps. We have tried to deploy this app inside Kubernetes with statefulsets and since the code lives inside sites and I cannot persist it, so a single image for all of it would be great.

Describe the solution you'd like

I'd like there to be a single Dockerfile which creates a frappe/health image.

Describe the alternatives you've considered

Additional context

If required I can submit a PR with a Dockerfile based on what has worked for us internally @Medblocks This solves a few issues that have been filed: #190 and #273

neutralboy commented 2 months ago

Dockerfile what we use is something super simple

FROM frappe/erpnext:v15.26.0
ARG APP_NAME=frontend
RUN bench get-app healthcare
CMD [ \
  "/home/frappe/frappe-bench/env/bin/gunicorn", \
  "--chdir=/home/frappe/frappe-bench/sites", \
  "--bind=0.0.0.0:8000", \
  "--threads=4", \
  "--workers=2", \
  "--worker-class=gthread", \
  "--worker-tmp-dir=/dev/shm", \
  "--timeout=120", \
  "--preload", \
  "frappe.app:application" \
]  

Then in production you just run

bench --site ${APP_NAME} install-app healthcare

before all the other processes are started. And it simply works