2
0
mirror of https://github.com/frappe/frappe_docker.git synced 2024-11-08 14:21:05 +00:00

docs: remove obsolete swarm related documentation (#763)

This commit is contained in:
Revant Nandgaonkar 2022-04-06 15:33:40 +05:30 committed by GitHub
parent 027c905355
commit b83938c0b8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 1 additions and 86 deletions

View File

@ -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

View File

@ -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.

View File

@ -1,7 +0,0 @@
version: "3.3"
services:
traefik:
command:
# Enable Docker Swarm mode
- --providers.docker.swarmmode

View File

@ -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.

View File

@ -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:

View File

@ -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.

View File

@ -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