diff --git a/README.md b/README.md index 2e847bc0..c9d5e5cb 100644 --- a/README.md +++ b/README.md @@ -21,33 +21,29 @@ cd frappe_docker Wait for 5 minutes for ERPNext site to be created or check `create-site` container logs before opening browser on port 8080. (username: `Administrator`, password: `admin`) -# Development +# Documentation -We have baseline for developing in VSCode devcontainer with [frappe/bench](https://github.com/frappe/bench). [Start development](development). +### [Production](#production) -# Production +- [List of containers](docs/list-of-containers.md) +- [Environment Variables](docs/environment-variables.md) +- [Single Server Example](docs/single-server-example.md) +- [Setup Options](docs/setup-options.md) +- [Site Operations](docs/site-operations.md) +- [Backup and Push Cron Job](docs/backup-and-push-cronjob.md) +- [Port Based Multi Tenancy](docs/port-based-multi-tenancy.md) +- [Migrate from multi-image setup](docs/migrate-from-multi-image-setup.md) -We provide simple and intuitive production setup with prebuilt Frappe and ERPNext images and compose files. To learn more about those, [read the docs](docs/images-and-compose-files.md). +### [Custom Images](#custom-images) -Also, there's docs to help with deployment: +- [Custom Apps](docs/custom-apps.md) +- [Build Version 10 Images](docs/build-version-10-images.md) +- [Bench Console and VSCode Debugger](docs/bench-console-and-vscode-debugger.md) +- [Connect to localhost services](docs/connect-to-localhost-services-from-containers-for-local-app-development.md) -- Examples: - - [Single Server](docs/single-server-example.md) - - [Setup options](docs/setup-options.md) - - [Kubernetes (frappe/helm)](https://helm.erpnext.com) -- [Site operations](docs/site-operations.md). -- Other - - [backup and push cron jobs](docs/backup-and-push-cronjob.md) - - [bench console and vscode debugger](docs/bench-console-and-vscode-debugger.md) - - [build version 10](docs/build-version-10-images.md) - - [connect to localhost services from containers for local app development](docs/connect-to-localhost-services-from-containers-for-local-app-development.md) - - [patch code from images](docs/patch-code-from-images.md) - - [port based multi tenancy](docs/port-based-multi-tenancy.md) -- [Troubleshoot](docs/troubleshoot.md) +### [Development](docs/development.md) -# Custom app - -Learn how to containerize your custom Frappe app(s) in [this guide](custom_app/README.md). +### [Troubleshoot](docs/troubleshoot.md) # Contributing diff --git a/docs/custom-apps.md b/docs/custom-apps.md new file mode 100644 index 00000000..0b25675a --- /dev/null +++ b/docs/custom-apps.md @@ -0,0 +1,90 @@ +### Clone frappe_docker and switch directory + +```shell +git clone https://github.com/frappe/frappe_docker +cd frappe_docker +``` + +### Load custom apps through json + +`apps.json` needs to be passed in as build arg environment variable. + +```shell +export APPS_JSON='[ + { + "url": "https://github.com/frappe/payments", + "branch": "develop" + }, + { + "url": "https://github.com/frappe/erpnext", + "branch": "version-14" + }, + { + "url": "https://user:password@git.example.com/project/repository.git", + "branch": "main" + } +]' +``` + +Note: + +- `url` needs to be http(s) git url with token/auth in case of private repo. + +### Build Image + +```shell +buildah build \ + --build-arg=FRAPPE_PATH=https://github.com/frappe/frappe \ + --build-arg=FRAPPE_BRANCH=version-14 \ + --build-arg=PYTHON_VERSION=3.10.5 \ + --build-arg=NODE_VERSION=16.18.0 \ + --build-arg=APPS_JSON=$APPS_JSON \ + --tag=ghcr.io/user/repo/custom:1.0.0 \ + --file=images/custom/Containerfile . +``` + +Note: + +- Use `docker` instead of `buildah` as per your setup. +- Make sure `APPS_JSON` variable has correct JSON. +- Make sure the `--tag` is valid image name that will be pushed to registry. +- Change `--build-arg` as per version of Python, NodeJS, Frappe Framework repo and branch + +### Push image to use in yaml files + +Login to `docker` or `buildah` + +```shell +buildah login +``` + +Push image + +```shell +buildah push ghcr.io/user/repo/custom:1.0.0 +``` + +### Use Kaniko + +Following executor args are required. Example runs locally in docker container. +You can run it part of CI/CD or part of your cluster. + +```shell +podman run --rm -it \ + -v "$HOME"/.docker/config.json:/kaniko/.docker/config.json \ + gcr.io/kaniko-project/executor:latest \ + --dockerfile=images/custom/Containerfile \ + --context=git://github.com/frappe/frappe_docker \ + --build-arg=FRAPPE_PATH=https://github.com/frappe/frappe \ + --build-arg=FRAPPE_BRANCH=version-14 \ + --build-arg=PYTHON_VERSION=3.10.5 \ + --build-arg=NODE_VERSION=16.18.0 \ + --build-arg=APPS_JSON=$APPS_JSON \ + --destination=ghcr.io/user/repo/custom:1.0.0 +``` + +More about [kaniko](https://github.com/GoogleContainerTools/kaniko) + +### Use Images + +Make sure image name is correct to be pushed to registry. After the images are pushed, you can pull them to servers to be deployed. If the registry is private, additional auth is needed. diff --git a/development/README.md b/docs/development.md similarity index 98% rename from development/README.md rename to docs/development.md index 464218a7..476314a4 100644 --- a/development/README.md +++ b/docs/development.md @@ -14,9 +14,9 @@ It is recommended you allocate at least 4GB of RAM to docker: - [Instructions for macOS](https://docs.docker.com/desktop/settings/mac/#advanced) Here is a screenshot showing the relevant setting in the Help Manual -![image](/docs/images/Docker%20Manual%20Screenshot%20-%20Resources%20section.png) +![image](images/Docker%20Manual%20Screenshot%20-%20Resources%20section.png) Here is a screenshot showing the settings in Docker Desktop on Mac -![images](/docs/images/Docker%20Desktop%20Screenshot%20-%20Resources%20section.png) +![images](images/Docker%20Desktop%20Screenshot%20-%20Resources%20section.png) ## Bootstrap Containers for development diff --git a/docs/environment-variables.md b/docs/environment-variables.md new file mode 100644 index 00000000..15e61818 --- /dev/null +++ b/docs/environment-variables.md @@ -0,0 +1,60 @@ +## Environment Variables + +All of the commands are directly passed to container as per type of service. Only environment variables used in image are for `nginx-entrypoint.sh` command. They are as follows: + +- `BACKEND`: Set to `{host}:{port}`, defaults to `0.0.0.0:8000` +- `SOCKETIO`: Set to `{host}:{port}`, defaults to `0.0.0.0:9000` +- `UPSTREAM_REAL_IP_ADDRESS`: Set Nginx config for [ngx_http_realip_module#set_real_ip_from](http://nginx.org/en/docs/http/ngx_http_realip_module.html#set_real_ip_from), defaults to `127.0.0.1` +- `UPSTREAM_REAL_IP_HEADER`: Set Nginx config for [ngx_http_realip_module#real_ip_header](http://nginx.org/en/docs/http/ngx_http_realip_module.html#real_ip_header), defaults to `X-Forwarded-For` +- `UPSTREAM_REAL_IP_RECURSIVE`: Set Nginx config for [ngx_http_realip_module#real_ip_recursive](http://nginx.org/en/docs/http/ngx_http_realip_module.html#real_ip_recursive) Set defaults to `off` +- `FRAPPE_SITE_NAME_HEADER`: Set proxy header `X-Frappe-Site-Name` and serve site named in the header, defaults to `$host`, i.e. find site name from host header. More details [below](#frappe_site_name_header) +- `PROXY_READ_TIMEOUT`: Upstream gunicorn service timeout, defaults to `120` +- `CLIENT_MAX_BODY_SIZE`: Max body size for uploads, defaults to `50m` + +To bypass `nginx-entrypoint.sh`, mount desired `/etc/nginx/conf.d/default.conf` and run `nginx -g 'daemon off;'` as container command. + +## Configuration + +We use environment variables to configure our setup. docker-compose uses variables from `.env` file. To get started, copy `example.env` to `.env`. + +### `FRAPPE_VERSION` + +Frappe framework release. You can find all releases [here](https://github.com/frappe/frappe/releases). + +### `DB_PASSWORD` + +Password for MariaDB (or Postgres) database. + +### `DB_HOST` + +Hostname for MariaDB (or Postgres) database. Set only if external service for database is used. + +### `DB_PORT` + +Port for MariaDB (3306) or Postgres (5432) database. Set only if external service for database is used. + +### `REDIS_CACHE` + +Hostname for redis server to store cache. Set only if external service for redis is used. + +### `REDIS_QUEUE` + +Hostname for redis server to store queue data. Set only if external service for redis is used. + +### `REDIS_SOCKETIO` + +Hostname for redis server to store socketio data. Set only if external service for redis is used. + +### `ERPNEXT_VERSION` + +ERPNext [release](https://github.com/frappe/frappe/releases). This variable is required if you use ERPNext override. + +### `LETSENCRYPT_EMAIL` + +Email that used to register https certificate. This one is required only if you use HTTPS override. + +### `FRAPPE_SITE_NAME_HEADER` + +This environment variable is not required. Default value is `$$host` which resolves site by host. For example, if your host is `example.com`, site's name should be `example.com`, or if host is `127.0.0.1` (local debugging), it should be `127.0.0.1` This variable allows to override described behavior. Let's say you create site named `mysite` and do want to access it by `127.0.0.1` host. Than you would set this variable to `mysite`. + +There is other variables not mentioned here. They're somewhat internal and you don't have to worry about them except you want to change main compose file. diff --git a/docs/images-and-compose-files.md b/docs/list-of-containers.md similarity index 66% rename from docs/images-and-compose-files.md rename to docs/list-of-containers.md index dafc46a6..d4562f4f 100644 --- a/docs/images-and-compose-files.md +++ b/docs/list-of-containers.md @@ -37,7 +37,6 @@ We have several [overrides](https://docs.docker.com/compose/extends/): - `overrides/compose.proxy.yaml`. Adds traefik proxy to setup. - `overrides/compose.noproxy.yaml`. Publishes `frontend` ports directly without any proxy. -- `overrides/compose.erpnext.yaml`. Replaces all Frappe images with ERPNext ones. ERPNext images are built on top of Frappe ones, so it is safe to replace them. - `overrides/compose.https.yaml`. Automatically sets up Let's Encrypt certificate and redirects all requests to directed to http, to https. - `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. @@ -47,55 +46,11 @@ It is quite simple to run overrides. All we need to do is to specify compose fil ```bash # Point to main compose file (compose.yaml) and add one more. -docker-compose -f compose.yaml -f overrides/compose.erpnext.yaml config +docker-compose -f compose.yaml -f overrides/compose.redis.yaml config ``` ⚠ Make sure to use docker-compose v2 (run `docker-compose -v` to check). If you want to use v1 make sure the correct `$`-signs as they get duplicated by the `config` command! That's it! Of course, we also have to setup `.env` before all of that, but that's not the point. -## Configuration - -We use environment variables to configure our setup. docker-compose uses variables from `.env` file. To get started, copy `example.env` to `.env`. - -### `FRAPPE_VERSION` - -Frappe framework release. You can find all releases [here](https://github.com/frappe/frappe/releases). - -### `DB_PASSWORD` - -Password for MariaDB (or Postgres) database. - -### `DB_HOST` - -Hostname for MariaDB (or Postgres) database. Set only if external service for database is used. - -### `DB_PORT` - -Port for MariaDB (3306) or Postgres (5432) database. Set only if external service for database is used. - -### `REDIS_CACHE` - -Hostname for redis server to store cache. Set only if external service for redis is used. - -### `REDIS_QUEUE` - -Hostname for redis server to store queue data. Set only if external service for redis is used. - -### `REDIS_SOCKETIO` - -Hostname for redis server to store socketio data. Set only if external service for redis is used. - -### `ERPNEXT_VERSION` - -ERPNext [release](https://github.com/frappe/frappe/releases). This variable is required if you use ERPNext override. - -### `LETSENCRYPT_EMAIL` - -Email that used to register https certificate. This one is required only if you use HTTPS override. - -### `FRAPPE_SITE_NAME_HEADER` - -This environment variable is not required. Default value is `$$host` which resolves site by host. For example, if your host is `example.com`, site's name should be `example.com`, or if host is `127.0.0.1` (local debugging), it should be `127.0.0.1` This variable allows to override described behavior. Let's say you create site named `mysite` and do want to access it by `127.0.0.1` host. Than you would set this variable to `mysite`. - -There is other variables not mentioned here. They're somewhat internal and you don't have to worry about them except you want to change main compose file. +Check [environment variables](environment-variables.md) for more. \ No newline at end of file diff --git a/docs/migrate-from-multi-image-setup.md b/docs/migrate-from-multi-image-setup.md new file mode 100644 index 00000000..c7616b9b --- /dev/null +++ b/docs/migrate-from-multi-image-setup.md @@ -0,0 +1,114 @@ +## Migrate from multi-image setup + +All the containers now use same image. Use `frappe/erpnext` instead of `frappe/frappe-worker`, `frappe/frappe-nginx` , `frappe/frappe-socketio` , `frappe/erpnext-worker` and `frappe/erpnext-nginx`. + +Now you need to specify command and environment variables for following containers: + +### Frontend + +For `frontend` service to act as static assets frontend and reverse proxy, you need to pass `nginx-entrypoint.sh` as container `command` and `BACKEND` and `SOCKETIO` environment variables pointing `{host}:{port}` for gunicorn and websocket services. Check [environment variables](environment-variables.md) + +Now you only need to mount the `sites` volume at location `/home/frappe/frappe-bench/sites`. No need for `assets` volume and asset population script or steps. + +Example change: + +```yaml +# ... removed for brevity + frontend: + image: frappe/erpnext:${ERPNEXT_VERSION:?ERPNext version not set} + command: + - nginx-entrypoint.sh + environment: + BACKEND: backend:8000 + SOCKETIO: websocket:9000 + volumes: + - sites:/home/frappe/frappe-bench/sites +# ... removed for brevity +``` + +### Websocket + +For `websocket` service to act as socketio backend, you need to pass `["node", "/home/frappe/frappe-bench/apps/frappe/socketio.js"]` as container `command` + +Example change: + +```yaml +# ... removed for brevity + websocket: + image: frappe/erpnext:${ERPNEXT_VERSION:?ERPNext version not set} + command: + - node + - /home/frappe/frappe-bench/apps/frappe/socketio.js +# ... removed for brevity +``` + +### Configurator + +For `configurator` service to act as run once configuration job, you need to pass `["bash", "-c"]` as container `entrypoint` and bash script inline to yaml. There is no `configure.py` in the container now. + +Example change: + +```yaml +# ... removed for brevity + configurator: + image: frappe/erpnext:${ERPNEXT_VERSION:?ERPNext version not set} + restart: "no" + entrypoint: + - bash + - -c + command: + - > + bench set-config -g db_host $$DB_HOST; + bench set-config -gp db_port $$DB_PORT; + bench set-config -g redis_cache "redis://$$REDIS_CACHE"; + bench set-config -g redis_queue "redis://$$REDIS_QUEUE"; + bench set-config -g redis_socketio "redis://$$REDIS_SOCKETIO"; + bench set-config -gp socketio_port $$SOCKETIO_PORT; + environment: + DB_HOST: db + DB_PORT: "3306" + REDIS_CACHE: redis-cache:6379 + REDIS_QUEUE: redis-queue:6379 + REDIS_SOCKETIO: redis-socketio:6379 + SOCKETIO_PORT: "9000" +# ... removed for brevity +``` + +### Site Creation + +For `create-site` service to act as run once site creation job, you need to pass `["bash", "-c"]` as container `entrypoint` and bash script inline to yaml. Make sure to use `--no-mariadb-socket` as upstream bench is installed in container. + +The `WORKDIR` has changed to `/home/frappe/frappe-bench` like `bench` setup we are used to. So the path to find `common_site_config.json` has changed to `sites/common_site_config.json`. + +Example change: + +```yaml +# ... removed for brevity + create-site: + image: frappe/erpnext:${ERPNEXT_VERSION:?ERPNext version not set} + restart: "no" + entrypoint: + - bash + - -c + command: + - > + wait-for-it -t 120 db:3306; + wait-for-it -t 120 redis-cache:6379; + wait-for-it -t 120 redis-queue:6379; + wait-for-it -t 120 redis-socketio:6379; + export start=`date +%s`; + until [[ -n `grep -hs ^ sites/common_site_config.json | jq -r ".db_host // empty"` ]] && \ + [[ -n `grep -hs ^ sites/common_site_config.json | jq -r ".redis_cache // empty"` ]] && \ + [[ -n `grep -hs ^ sites/common_site_config.json | jq -r ".redis_queue // empty"` ]]; + do + echo "Waiting for sites/common_site_config.json to be created"; + sleep 5; + if (( `date +%s`-start > 120 )); then + echo "could not find sites/common_site_config.json with required keys"; + exit 1 + fi + done; + echo "sites/common_site_config.json found"; + bench new-site frontend --no-mariadb-socket --admin-password=admin --db-root-password=admin --install-app payments --install-app erpnext --set-default; +# ... removed for brevity +``` diff --git a/docs/patch-code-from-images.md b/docs/patch-code-from-images.md deleted file mode 100644 index 7db32b02..00000000 --- a/docs/patch-code-from-images.md +++ /dev/null @@ -1,14 +0,0 @@ -Example: https://discuss.erpnext.com/t/sms-two-factor-authentication-otp-msg-change/47835 - -Above example needs following Dockerfile based patch - -```Dockerfile -FROM frappe/erpnext:v14 - -... -USER root -RUN sed -i -e "s/Your verification code is/আপনার লগইন কোড/g" /home/frappe/frappe-bench/apps/frappe/frappe/twofactor.py -USER frappe -... - -``` diff --git a/docs/port-based-multi-tenancy.md b/docs/port-based-multi-tenancy.md index 660c30bf..2f469bfd 100644 --- a/docs/port-based-multi-tenancy.md +++ b/docs/port-based-multi-tenancy.md @@ -6,43 +6,64 @@ Remove the traefik service from docker-compose.yml ### Step 2 -Create nginx config file `/opt/nginx/conf/serve-8001.conf`: +Add service for each port that needs to be exposed. -``` -server { - listen 8001; - server_name $http_host; +e.g. `port-site-1`, `port-site-2`, `port-site-3`. - location / { - - rewrite ^(.+)/$ $1 permanent; - rewrite ^(.+)/index\.html$ $1 permanent; - rewrite ^(.+)\.html$ $1 permanent; - - proxy_set_header X-Frappe-Site-Name mysite.localhost; - proxy_set_header Host mysite.localhost; - proxy_pass http://frontend; - } -} +```yaml +# ... removed for brevity +services: + # ... removed for brevity + port-site-1: + image: frappe/erpnext:v14.11.1 + deploy: + restart_policy: + condition: on-failure + command: + - nginx-entrypoint.sh + environment: + BACKEND: backend:8000 + FRAPPE_SITE_NAME_HEADER: site1.local + SOCKETIO: websocket:9000 + volumes: + - sites:/home/frappe/frappe-bench/sites + ports: + - "8080:8080" + port-site-2: + image: frappe/erpnext:v14.11.1 + deploy: + restart_policy: + condition: on-failure + command: + - nginx-entrypoint.sh + environment: + BACKEND: backend:8000 + FRAPPE_SITE_NAME_HEADER: site2.local + SOCKETIO: websocket:9000 + volumes: + - sites:/home/frappe/frappe-bench/sites + ports: + - "8081:8080" + port-site-3: + image: frappe/erpnext:v14.11.1 + deploy: + restart_policy: + condition: on-failure + command: + - nginx-entrypoint.sh + environment: + BACKEND: backend:8000 + FRAPPE_SITE_NAME_HEADER: site3.local + SOCKETIO: websocket:9000 + volumes: + - sites:/home/frappe/frappe-bench/sites + ports: + - "8082:8080" ``` Notes: -- Replace the port with any port of choice e.g. `listen 4200;` -- Change `mysite.localhost` to site name -- Repeat the server blocks for multiple ports and site names to get the effect of port based multi tenancy -- For old images use `proxy_pass http://erpnext-nginx` instead of `proxy_pass http://frontend` - -### Step 3 - -Run the docker container - -```shell -docker run --network=_default \ - -p 8001:8001 \ - --volume=/opt/nginx/conf/serve-8001.conf:/etc/nginx/conf.d/default.conf -d nginx -``` - -Note: Change the volumes, network and ports as needed - -With the above example configured site will be accessible on `http://localhost:8001` +- Above setup will expose `site1.local`, `site2.local`, `site3.local` on port `8080`, `8081`, `8082` respectively. +- Change `site1.local` to site name to serve from bench. +- Change the `BACKEND` and `SOCKETIO` environment variables as per your service names. +- Make sure `sites:` volume is available as part of yaml. diff --git a/docs/setup-options.md b/docs/setup-options.md index bc74d4d1..0fd9fbbe 100644 --- a/docs/setup-options.md +++ b/docs/setup-options.md @@ -60,7 +60,6 @@ environment variables or the `configurator` will fail. # Generate YAML docker compose -f compose.yaml \ -f overrides/compose.proxy.yaml \ - -f overrides/compose.erpnext.yaml \ config > ~/gitops/docker-compose.yml # Start containers @@ -86,7 +85,6 @@ docker compose --project-name -f ~/gitops/docker-compose.yml up - ```sh # Generate YAML docker compose -f compose.yaml \ - -f overrides/compose.erpnext.yaml \ -f overrides/compose.mariadb.yaml \ -f overrides/compose.redis.yaml \ -f overrides/compose.https.yaml \ @@ -110,7 +108,6 @@ nano .env # Pull new images docker compose -f compose.yaml \ - -f overrides/compose.erpnext.yaml \ # ... your other overrides config > ~/gitops/docker-compose.yml diff --git a/docs/single-server-example.md b/docs/single-server-example.md index a13205f2..11f5b12b 100644 --- a/docs/single-server-example.md +++ b/docs/single-server-example.md @@ -87,13 +87,13 @@ Deploy the traefik container with letsencrypt SSL ```shell docker compose --project-name traefik \ --env-file ~/gitops/traefik.env \ - -f docs/compose/compose.traefik.yaml \ - -f docs/compose/compose.traefik-ssl.yaml up -d + -f overrides/compose.traefik.yaml \ + -f overrides/compose.traefik-ssl.yaml up -d ``` This will make the traefik dashboard available on `traefik.example.com` and all certificates will reside in `/data/traefik/certificates` on host filesystem. -For LAN setup deploy the traefik container without overriding `docs/compose/compose.traefik-ssl.yaml`. +For LAN setup deploy the traefik container without overriding `overrides/compose.traefik-ssl.yaml`. ### Install MariaDB @@ -120,7 +120,7 @@ Note: Change the password from `changeit` to more secure one. Deploy the mariadb container ```shell -docker compose --project-name mariadb --env-file ~/gitops/mariadb.env -f docs/compose/compose.mariadb-shared.yaml up -d +docker compose --project-name mariadb --env-file ~/gitops/mariadb.env -f overrides/compose.mariadb-shared.yaml up -d ``` This will make `mariadb-database` service available under `mariadb-network`. Data will reside in `/data/mariadb`. @@ -155,10 +155,9 @@ Create a yaml file called `erpnext-one.yaml` in `~/gitops` directory: docker compose --project-name erpnext-one \ --env-file ~/gitops/erpnext-one.env \ -f compose.yaml \ - -f overrides/compose.erpnext.yaml \ -f overrides/compose.redis.yaml \ - -f docs/compose/compose.multi-bench.yaml \ - -f docs/compose/compose.multi-bench-ssl.yaml config > ~/gitops/erpnext-one.yaml + -f overrides/compose.multi-bench.yaml \ + -f overrides/compose.multi-bench-ssl.yaml config > ~/gitops/erpnext-one.yaml ``` For LAN setup do not override `compose.multi-bench-ssl.yaml`. @@ -217,10 +216,9 @@ Create a yaml file called `erpnext-two.yaml` in `~/gitops` directory: docker compose --project-name erpnext-two \ --env-file ~/gitops/erpnext-two.env \ -f compose.yaml \ - -f overrides/compose.erpnext.yaml \ -f overrides/compose.redis.yaml \ - -f docs/compose/compose.multi-bench.yaml \ - -f docs/compose/compose.multi-bench-ssl.yaml config > ~/gitops/erpnext-two.yaml + -f overrides/compose.multi-bench.yaml \ + -f overrides/compose.multi-bench-ssl.yaml config > ~/gitops/erpnext-two.yaml ``` Use the above command after any changes are made to `erpnext-two.env` file to regenerate `~/gitops/erpnext-two.yaml`. e.g. after changing version to migrate the bench. @@ -271,8 +269,8 @@ Generate yaml to reverse proxy: ```shell docker compose --project-name custom-one-example \ --env-file ~/gitops/custom-one-example.env \ - -f docs/compose/compose.custom-domain.yaml \ - -f docs/compose/compose.custom-domain-ssl.yaml config > ~/gitops/custom-one-example.yaml + -f overrides/compose.custom-domain.yaml \ + -f overrides/compose.custom-domain-ssl.yaml config > ~/gitops/custom-one-example.yaml ``` For LAN setup do not override `compose.custom-domain-ssl.yaml`. diff --git a/docs/troubleshoot.md b/docs/troubleshoot.md index ca7d9bc7..eb5a9167 100644 --- a/docs/troubleshoot.md +++ b/docs/troubleshoot.md @@ -1,5 +1,4 @@ 1. [Fixing MariaDB issues after rebuilding the container](#fixing-mariadb-issues-after-rebuilding-the-container) -1. [Letsencrypt companion not working](#letsencrypt-companion-not-working) 1. [docker-compose does not recognize variables from `.env` file](#docker-compose-does-not-recognize-variables-from-env-file) 1. [Windows Based Installation](#windows-based-installation) @@ -46,12 +45,11 @@ Note: For MariaDB 10.4 and above use `mysql.global_priv` instead of `mysql.user` ### docker-compose does not recognize variables from `.env` file -If you are using old version of `docker-compose` the .env file needs to be located in directory from where the docker-compose command is executed. There may also be difference in official `docker-compose` and the one packaged by distro. +If you are using old version of `docker-compose` the .env file needs to be located in directory from where the docker-compose command is executed. There may also be difference in official `docker-compose` and the one packaged by distro. Use `--env-file=.env` if available to explicitly specify the path to file. ### Windows Based Installation - Set environment variable `COMPOSE_CONVERT_WINDOWS_PATHS` e.g. `set COMPOSE_CONVERT_WINDOWS_PATHS=1` -- Make the `frappe-mariadb.cnf` read-only for mariadb container to pick it up. - While using docker machine, port-forward the port 80 of VM to port 80 of host machine - Name all the sites ending with `.localhost`. and access it via browser locally. e.g. `http://site1.localhost` - related issue comment https://github.com/frappe/frappe_docker/issues/448#issuecomment-851723912 diff --git a/docs/compose/compose.custom-domain-ssl.yaml b/overrides/compose.custom-domain-ssl.yaml similarity index 100% rename from docs/compose/compose.custom-domain-ssl.yaml rename to overrides/compose.custom-domain-ssl.yaml diff --git a/docs/compose/compose.custom-domain.yaml b/overrides/compose.custom-domain.yaml similarity index 100% rename from docs/compose/compose.custom-domain.yaml rename to overrides/compose.custom-domain.yaml diff --git a/docs/compose/compose.mariadb-shared.yaml b/overrides/compose.mariadb-shared.yaml similarity index 100% rename from docs/compose/compose.mariadb-shared.yaml rename to overrides/compose.mariadb-shared.yaml diff --git a/docs/compose/compose.multi-bench-ssl.yaml b/overrides/compose.multi-bench-ssl.yaml similarity index 100% rename from docs/compose/compose.multi-bench-ssl.yaml rename to overrides/compose.multi-bench-ssl.yaml diff --git a/docs/compose/compose.multi-bench.yaml b/overrides/compose.multi-bench.yaml similarity index 100% rename from docs/compose/compose.multi-bench.yaml rename to overrides/compose.multi-bench.yaml diff --git a/docs/compose/compose.traefik-ssl.yaml b/overrides/compose.traefik-ssl.yaml similarity index 100% rename from docs/compose/compose.traefik-ssl.yaml rename to overrides/compose.traefik-ssl.yaml diff --git a/docs/compose/compose.traefik.yaml b/overrides/compose.traefik.yaml similarity index 100% rename from docs/compose/compose.traefik.yaml rename to overrides/compose.traefik.yaml