diff --git a/README.md b/README.md index 4699ce22..e48b6dab 100644 --- a/README.md +++ b/README.md @@ -34,7 +34,6 @@ Also, there's docs to help with deployment: - [Setup options](docs/setup-options.md) - Examples: - [Single Server](docs/single-server-example.md) - - [Docker Swarm](docs/docker-swarm.md), - [Kubernetes (frappe/helm)](https://helm.erpnext.com), - [site operations](docs/site-operations.md). - Other diff --git a/docs/backup-and-push-cronjob.md b/docs/backup-and-push-cronjob.md index ec2f3827..bba44ef1 100644 --- a/docs/backup-and-push-cronjob.md +++ b/docs/backup-and-push-cronjob.md @@ -27,15 +27,6 @@ services: - ENDPOINT_URL=https://endpoint.url volumes: - "sites-vol:/home/frappe/frappe-bench/sites" - # Uncomment in case of Docker Swarm with crazy-max/swarm-cronjob - # deploy: - # labels: - # - "swarm.cronjob.enable=true" - # - "swarm.cronjob.schedule=0 */3 * * *" - # - "swarm.cronjob.skip-running=true" - # replicas: 0 - # restart_policy: - # condition: none networks: - erpnext-network @@ -58,6 +49,4 @@ In case of single docker host setup, add crontab entry for backup every 6 hours. Notes: -- Install [crazy-max/swarm-cronjob](https://github.com/crazy-max/swarm-cronjob) for docker swarm. -- Uncomment `deploy` section in case of usage on docker swarm. - Change the cron string as per need. diff --git a/docs/compose/compose.traefik-swarm.yaml b/docs/compose/compose.traefik-swarm.yaml deleted file mode 100644 index cf310165..00000000 --- a/docs/compose/compose.traefik-swarm.yaml +++ /dev/null @@ -1,7 +0,0 @@ -version: "3.3" - -services: - traefik: - command: - # Enable Docker Swarm mode - - --providers.docker.swarmmode diff --git a/docs/docker-swarm.md b/docs/docker-swarm.md deleted file mode 100644 index d7d03fdc..00000000 --- a/docs/docker-swarm.md +++ /dev/null @@ -1,55 +0,0 @@ -## Prerequisites - -- [yq](https://mikefarah.gitbook.io/yq) -- [docker-compose](https://docs.docker.com/compose/) -- [docker swarm](https://docs.docker.com/engine/swarm/) - -#### Generate setup for docker swarm - -Generate the swarm compatible YAML, - -```bash -docker-compose -f compose.yaml \ - -f overrides/compose.erpnext.yaml \ - -f overrides/compose.swarm.yaml \ - -f overrides/compose.https.yaml \ - config \ - | yq eval 'del(.services.*.depends_on) | del(.services.frontend.labels)' - \ - | yq eval '.services.proxy.command += "--providers.docker.swarmmode"' - > \ - ~/gitops/compose.yaml -``` - -In case you need to generate config for multiple benches. Install the proxy separately only once and generate stacks for each bench as follows: - -```bash -# Setup Bench $BENCH_SUFFIX -export BENCH_SUFFIX=one -docker-compose -f compose.yaml \ - -f overrides/compose.erpnext.yaml \ - -f overrides/compose.swarm.yaml \ - config \ - | yq eval 'del(.services.*.depends_on) | del(.services.frontend.labels)' - \ - | sed "s|frontend|frontend-${BENCH_SUFFIX}|g" \ - | yq eval ".services.frontend-${BENCH_SUFFIX}.\"networks\"=[\"traefik-public\",\"default\"]" - \ - | yq eval ".\"networks\"={\"traefik-public\":{\"external\":true}}" - > \ - ~/gitops/compose-${BENCH_SUFFIX}.yaml -``` - -Commands explained: - -- `docker-compose -f ... -f ... config`, this command generates the YAML based on the overrides -- `yq eval 'del(.services.*.depends_on) | del(.services.frontend.labels)'`, this command removes the `depends_on` from all services and `labels` from frontend generated from previous command. -- `yq eval '.services.proxy.command += "--providers.docker.swarmmode"'`, this command enables swarmmode for traefik proxy. -- `sed "s|frontend|frontend-${BENCH_SUFFIX}|g"`, this command replaces the service name `frontend` with `frontend-` and `BENCH_SUFFIX` provided. -- `yq eval ".services.frontend-${BENCH_SUFFIX}.\"networks\"=[\"traefik-public\",\"default\"]"`, this command attaches `traefik-public` and `default` network to frontend service. -- `yq eval ".\"networks\"={\"traefik-public\":{\"external\":true}}"`, this commands adds external network `traefik-public` to the stack - -Notes: - -- Set `BENCH_SUFFIX` to the stack name. the stack will be located at `~/gitops/compose-${BENCH_SUFFIX}.yaml`. -- `traefik-public` is assumed to be the network for traefik loadbalancer for swarm. -- Once the stack YAML is generated, you can edit it further for advance setup and commit it to your gitops - -#### Site Operations - -Refer [site operations documentation](./site-operations.md) to create new site, migrate site, drop site and perform other site operations. diff --git a/docs/images-and-compose-files.md b/docs/images-and-compose-files.md index ab3d01e0..dafc46a6 100644 --- a/docs/images-and-compose-files.md +++ b/docs/images-and-compose-files.md @@ -42,7 +42,6 @@ We have several [overrides](https://docs.docker.com/compose/extends/): - `overrides/compose.mariadb.yaml`. Adds `db` service and sets its image to MariaDB. - `overrides/compose.postgres.yaml`. Adds `db` service and sets its image to Postgres. Note that ERPNext currently doesn't support Postgres. - `overrides/compose.redis.yaml`. Adds `redis` service and sets its image to `redis`. -- `overrides/compose.swarm.yaml`. Workaround override for generating swarm stack. It is quite simple to run overrides. All we need to do is to specify compose files that should be used by docker-compose. For example, we want ERPNext: diff --git a/docs/single-server-example.md b/docs/single-server-example.md index 73da4ddf..96c44032 100644 --- a/docs/single-server-example.md +++ b/docs/single-server-example.md @@ -12,7 +12,7 @@ We will setup the following: Explanation: -Single instance of **Traefik** will be installed and act as internal loadbalancer for multiple benches and sites hosted on the server. It can also load balance other applications along with frappe benches, e.g. wordpress, metabase, etc. We only expose the ports `80` and `443` once with this instance of traefik. Traefik will also take care of letsencrypt automation for all sites installed on the server. _Why choose Traefik over Nginx Proxy Manager?_ Traefik doesn't need additional DB service and can store certificates in a json file in a volume. Traefik will also be used in swarm setup keeping things consistent for understanding. +Single instance of **Traefik** will be installed and act as internal loadbalancer for multiple benches and sites hosted on the server. It can also load balance other applications along with frappe benches, e.g. wordpress, metabase, etc. We only expose the ports `80` and `443` once with this instance of traefik. Traefik will also take care of letsencrypt automation for all sites installed on the server. _Why choose Traefik over Nginx Proxy Manager?_ Traefik doesn't need additional DB service and can store certificates in a json file in a volume. Single instance of **MariaDB** will be installed and act as database service for all the benches/projects installed on the server. diff --git a/overrides/compose.swarm.yaml b/overrides/compose.swarm.yaml deleted file mode 100644 index cc3da5ec..00000000 --- a/overrides/compose.swarm.yaml +++ /dev/null @@ -1,10 +0,0 @@ -services: - frontend: - deploy: - restart_policy: - condition: on-failure - labels: - traefik.enable: true - traefik.http.services.frontend.loadbalancer.server.port: 8080 - traefik.http.routers.frontend-http.entrypoints: websecure - traefik.http.routers.frontend-http.tls.certresolver: main-resolver