2
0
mirror of https://github.com/frappe/frappe_docker.git synced 2024-11-08 14:21:05 +00:00
frappe_docker/docs/single-compose-setup.md
Revant Nandgaonkar e6088af885
refactor: build only one frappe/erpnext image (#1032)
* ci: skip frappe builds

* refactor: build only one frappe/erpnext image

* fix: lint nginx entrypoint script

* docs: update and organize docs

* docs: fix lint errors

* fix(custom): pass base64 encoded apps json

* ci: update dependabot

* docs: update contributing

* docs: remove info about multi image setup

* fix: initiate empty common_site_config.json

default config has host keys set to localhost
causes connection errors

* docs: add details for pwd volumes

* fix: symlink assets instead of copy

* fix: nginx private files

* ci: skip docker compose v2 install for ubuntu-latest

* fix: organize layers

* feat: allow remove git remote for custom image

* docs: allow remove git remote for custom image

* fix: remove duplicate --apps_path
2023-01-16 04:20:09 +05:30

1.8 KiB

Single Compose Setup

This setup is a very simple single compose file that does everything to start required services and a frappe-bench. It is used to start play with docker instance with a site. The file is located in the root of repo and named pwd.yml.

Services

frappe-bench components

  • backend, serves gunicorn backend
  • frontend, serves static assets through nginx frontend reverse proxies websocket and gunicorn.
  • queue-default, default rq worker.
  • queue-long, long rq worker.
  • queue-short, short rq worker.
  • schedule, event scheduler.
  • websocket, socketio websocket for realtime communication.

Run once configuration

  • configurator, configures common_site_config.json to set db and redis hosts.
  • create-site, creates one site to serve as default site for the frappe-bench.

Service dependencies

  • db, mariadb, container with frappe specific configuration.
  • redis-cache, redis for cache data.
  • redis-queue, redis for rq data.
  • redis-socketio, redis for socketio pubsub.

Volumes

  • sites: Volume for bench data. Common config, all sites, all site configs and site files will be stored here.
  • logs: Volume for bench logs. all process logs are dumped here. No need to mount it. Each container will create a temporary volume for logs if not specified.

Adaptation

If you understand containers use the pwd.yml as a reference to build more complex setup like, single server example, Docker Swarm stack, Kubernetes Helm chart, etc.

This serves only site called frontend through the nginx. FRAPPE_SITE_NAME_HEADER is set to frontend and a default site called frontend is created.

Change the $$host will allow container to accept any host header and serve that site. To escape $ in compose yaml use it like $$. To unset default site remove currentsite.txt file from sites directory.