diff --git a/.env b/.env index 0369861..31a252a 100644 --- a/.env +++ b/.env @@ -1,8 +1,10 @@ APP_PORT=9001 APP_NAME=erpnext DB_MARIA_PASSWORD=LFVKy9ra9Njy2E - - +# use Internet IP if no domain +APP_URL=erpnext.example.com +APP_USER=Administrator +APP_PASSWORD=admin # Reference: https://github.com/frappe/frappe_docker/blob/main/docs/images-and-compose-files.md @@ -10,7 +12,8 @@ DB_MARIA_PASSWORD=LFVKy9ra9Njy2E FRAPPE_VERSION=v13.30.0 # Only with ERPNext override -ERPNEXT_VERSION=v13.31.1 +# V12, V13, V14 is OK +ERPNEXT_VERSION=v12 DB_PASSWORD=$DB_MARIA_PASSWORD diff --git a/Notes.md b/Notes.md index 1d153bf..a3c163c 100644 --- a/Notes.md +++ b/Notes.md @@ -1,20 +1,29 @@ # ERPNext -## About Install +## Install 官方非常及时的更新了安装所需的镜像,且提供了灵活多变的 docker compose 文件以供用户使用。 由于过于灵活,导致理解起来有些困难。 实际上 ERPNext 的安装比较简单: -1. 将 example.env 另存成 .env -2. 启动时引入主 compose 文件以及有选择性的启动 overrides 文件夹下的 docker compose 文件 (多 compose 文件的用法) +1. 将 example.env 另存为根目录 .env +2. 将 compose.yaml 另存为根目录下 compose.yaml 或 docker-compose.yml,然后略加修改。接下来有两个可选方案: +3. 方案一:使用 compose convert 命令合并多个 compose 为一个完整的 compose 文件(环境变量会替换),然后启动容器 ``` -docker compose -f compose.yaml -f ./overrides/compose.mariadb.yaml -f ... up -d +docker compose -f compose.yaml -f src/overrides/compose.erpnext.yaml -f src/overrides/compose.redis.yaml -f src/overrides/compose.mariadb.yaml convert > docker-compose.yml +``` +4. 方案二(推荐):启动时引入主 compose 文件以及有选择性的启动 overrides 文件夹下的 docker compose 文件 (多 compose 文件的用法) +``` +docker compose -f docker-compose.yml -f src/overrides/compose.erpnext.yaml -f src/overrides/compose.redis.yaml -f src/overrides/compose.mariadb.yaml up -d ``` -3. 主服务 backend 中创建一个 erpnext 项目(此步骤很容易被忽略) +5. 主服务 backend 中创建一个 erpnext 项目(此步骤是必须的,但很容易被忽略) ``` -docker-compose exec backend bench new-site --mariadb-root-password --admin-password +APP_URL=8.218.129.87 +docker compose exec backend bench new-site youurl --mariadb-root-password yourpassword --admin-password admin123 + +or + ``` 参考:https://github1s.com/frappe/frappe_docker/blob/HEAD/docs/site-operations.md @@ -27,7 +36,15 @@ password: admin #### ERPNext 镜像与 Frappe 镜像有什么区别? -有待研究,实验中发现 ERPNext 不会出现图片乱码问题 +经过研究,ERPNext 是官方推出的新的镜像,感觉未来应该推荐使用它。 + +实验中发现 ERPNext 不会出现图片乱码问题 + +#### 究竟如何部署 ERPNext? + +从官方源码中发现,安装文档指南(单一服务器)中对安装写得过于繁琐,但实际上只需采用 overrides 中多个 compose 文件即可快速安装。 + +这是怎么回事呢?通过官方的论坛中研究,发现这是文档更新不及时导致,也就是说overrides中的安装在文档中还没有体现,虽然它更具有效率。 #### 与URL有关的变量有那些? diff --git a/compose.erpnext.yaml b/compose.erpnext.yaml deleted file mode 100644 index 36f10ad..0000000 --- a/compose.erpnext.yaml +++ /dev/null @@ -1,24 +0,0 @@ -x-erpnext-backend-image: &erpnext_backend_image - image: frappe/erpnext-worker:${ERPNEXT_VERSION:?No ERPNext version set} - -services: - configurator: - <<: *erpnext_backend_image - - backend: - <<: *erpnext_backend_image - - frontend: - image: frappe/erpnext-nginx:${ERPNEXT_VERSION} - - queue-short: - <<: *erpnext_backend_image - - queue-default: - <<: *erpnext_backend_image - - queue-long: - <<: *erpnext_backend_image - - scheduler: - <<: *erpnext_backend_image diff --git a/compose.mariadb.yaml b/compose.mariadb.yaml deleted file mode 100644 index cd719b6..0000000 --- a/compose.mariadb.yaml +++ /dev/null @@ -1,27 +0,0 @@ -services: - configurator: - environment: - DB_HOST: db - DB_PORT: 3306 - depends_on: - db: - condition: service_healthy - - db: - image: mariadb:10.6 - healthcheck: - test: mysqladmin ping -h localhost --password=${DB_PASSWORD} - interval: 1s - retries: 15 - command: - - --character-set-server=utf8mb4 - - --collation-server=utf8mb4_unicode_ci - - --skip-character-set-client-handshake - - --skip-innodb-read-only-compressed # Temporary fix for MariaDB 10.6 - environment: - MYSQL_ROOT_PASSWORD: ${DB_PASSWORD:?No db password set} - volumes: - - db-data:/var/lib/mysql - -volumes: - db-data: diff --git a/compose.noproxy.yaml b/compose.noproxy.yaml deleted file mode 100644 index 5c4f83c..0000000 --- a/compose.noproxy.yaml +++ /dev/null @@ -1,4 +0,0 @@ -services: - frontend: - ports: - - 8080:8080 diff --git a/compose.redis.yaml b/compose.redis.yaml deleted file mode 100644 index 5bd3a0a..0000000 --- a/compose.redis.yaml +++ /dev/null @@ -1,16 +0,0 @@ -services: - configurator: - environment: - REDIS_CACHE: redis:6379/0 - REDIS_QUEUE: redis:6379/1 - REDIS_SOCKETIO: redis:6379/2 - depends_on: - - redis - - redis: - image: redis:6.2-alpine - volumes: - - redis-data:/data - -volumes: - redis-data: diff --git a/docker-compose.yml b/docker-compose.yml index 65ddc46..6b04d61 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,3 +1,9 @@ +# based on compose.yaml +# --------------modified start ------------------------------------- +# backend: add envs, add container_name +# frontend: add ports +# --------------modified end------------------------------------- + x-depends-on-configurator: &depends_on_configurator depends_on: configurator: @@ -24,6 +30,11 @@ services: backend: <<: *backend_defaults + container_name: $APP_NAME-backend + environment: + - APP_URL + - APP_PASSWORD + - DB_PASSWORD volumes: - sites:/home/frappe/frappe-bench/sites - assets:/home/frappe/frappe-bench/sites/assets:ro @@ -31,6 +42,8 @@ services: frontend: image: frappe/frappe-nginx:${FRAPPE_VERSION} container_name: $APP_NAME + ports: + - $APP_PORT:8080 environment: BACKEND: backend:8000 SOCKETIO: websocket:9000 @@ -70,4 +83,4 @@ services: # ERPNext requires local assets access (Frappe does not) volumes: sites: - assets: \ No newline at end of file + assets: diff --git a/src/docker-compose.yml b/src/docker-compose.yml deleted file mode 100644 index 5ca8569..0000000 --- a/src/docker-compose.yml +++ /dev/null @@ -1,174 +0,0 @@ -version: "3" - -services: - traefik: - image: "traefik:v2.2" - command: - - "--log.level=DEBUG" - - "--providers.docker=true" - - "--providers.docker.exposedbydefault=false" - - "--entrypoints.web.address=:80" - - "--entrypoints.websecure.address=:443" - - "--certificatesresolvers.myresolver.acme.httpchallenge=true" - - "--certificatesresolvers.myresolver.acme.httpchallenge.entrypoint=web" - - "--certificatesresolvers.myresolver.acme.email=${LETSENCRYPT_EMAIL}" - - "--certificatesresolvers.myresolver.acme.storage=/letsencrypt/acme.json" - labels: - # enable traefik - - "traefik.enable=true" - # global redirect to https for production only - - "${HTTPS_REDIRECT_RULE_LABEL}" - - "${HTTPS_REDIRECT_ENTRYPOINT_LABEL}" - - "${HTTPS_REDIRECT_MIDDLEWARE_LABEL}" - # middleware redirect for production only - - "${HTTPS_USE_REDIRECT_MIDDLEWARE_LABEL}" - ports: - - "80:80" - - "443:443" - volumes: - - cert-vol:/letsencrypt - - /var/run/docker.sock:/var/run/docker.sock:ro - userns_mode: "host" - - erpnext-nginx: - image: frappe/erpnext-nginx:${ERPNEXT_VERSION} - restart: on-failure - environment: - - FRAPPE_PY=erpnext-python - - FRAPPE_PY_PORT=8000 - - FRAPPE_SOCKETIO=frappe-socketio - - SOCKETIO_PORT=9000 - - SKIP_NGINX_TEMPLATE_GENERATION=${SKIP_NGINX_TEMPLATE_GENERATION} - labels: - - "traefik.enable=true" - - "traefik.http.routers.erpnext-nginx.rule=Host(${SITES})" - - "${ENTRYPOINT_LABEL}" - - "${CERT_RESOLVER_LABEL}" - - "traefik.http.services.erpnext-nginx.loadbalancer.server.port=80" - volumes: - - sites-vol:/var/www/html/sites:rw - - assets-vol:/assets:rw - - erpnext-python: - image: frappe/erpnext-worker:${ERPNEXT_VERSION} - restart: on-failure - environment: - - MARIADB_HOST=${MARIADB_HOST} - - REDIS_CACHE=redis-cache:6379 - - REDIS_QUEUE=redis-queue:6379 - - REDIS_SOCKETIO=redis-socketio:6379 - - SOCKETIO_PORT=9000 - - AUTO_MIGRATE=1 - - WORKER_CLASS=${WORKER_CLASS} - volumes: - - sites-vol:/home/frappe/frappe-bench/sites:rw - - assets-vol:/home/frappe/frappe-bench/sites/assets:rw - - frappe-socketio: - image: frappe/frappe-socketio:${FRAPPE_VERSION} - restart: on-failure - depends_on: - - redis-socketio - volumes: - - sites-vol:/home/frappe/frappe-bench/sites:rw - - logs-vol:/home/frappe/frappe-bench/logs:rw - - erpnext-worker-default: - image: frappe/erpnext-worker:${ERPNEXT_VERSION} - restart: on-failure - command: worker - depends_on: - - redis-queue - - redis-cache - volumes: - - sites-vol:/home/frappe/frappe-bench/sites:rw - - logs-vol:/home/frappe/frappe-bench/logs:rw - - erpnext-worker-short: - image: frappe/erpnext-worker:${ERPNEXT_VERSION} - restart: on-failure - command: worker - environment: - - WORKER_TYPE=short - depends_on: - - redis-queue - - redis-cache - volumes: - - sites-vol:/home/frappe/frappe-bench/sites:rw - - logs-vol:/home/frappe/frappe-bench/logs:rw - - erpnext-worker-long: - image: frappe/erpnext-worker:${ERPNEXT_VERSION} - restart: on-failure - command: worker - environment: - - WORKER_TYPE=long - depends_on: - - redis-queue - - redis-cache - volumes: - - sites-vol:/home/frappe/frappe-bench/sites:rw - - erpnext-schedule: - image: frappe/erpnext-worker:${ERPNEXT_VERSION} - restart: on-failure - command: schedule - depends_on: - - redis-queue - - redis-cache - volumes: - - sites-vol:/home/frappe/frappe-bench/sites:rw - - logs-vol:/home/frappe/frappe-bench/logs:rw - - redis-cache: - image: redis:latest - restart: on-failure - volumes: - - redis-cache-vol:/data - - redis-queue: - image: redis:latest - restart: on-failure - volumes: - - redis-queue-vol:/data - - redis-socketio: - image: redis:latest - restart: on-failure - volumes: - - redis-socketio-vol:/data - - mariadb: - image: mariadb:10.3 - restart: on-failure - environment: - - MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD} - volumes: - - ./installation/frappe-mariadb.cnf:/etc/mysql/conf.d/frappe.cnf - - mariadb-vol:/var/lib/mysql - - site-creator: - image: frappe/erpnext-worker:${ERPNEXT_VERSION} - restart: "no" - command: new - depends_on: - - erpnext-python - environment: - - SITE_NAME=${SITE_NAME} - - DB_ROOT_USER=${DB_ROOT_USER} - - MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD} - - ADMIN_PASSWORD=${ADMIN_PASSWORD} - - INSTALL_APPS=${INSTALL_APPS} - volumes: - - sites-vol:/home/frappe/frappe-bench/sites:rw - - logs-vol:/home/frappe/frappe-bench/logs:rw - -volumes: - mariadb-vol: - redis-cache-vol: - redis-queue-vol: - redis-socketio-vol: - assets-vol: - sites-vol: - cert-vol: - logs-vol: diff --git a/src/example.env b/src/example.env index 47c176d..d12c8b7 100644 --- a/src/example.env +++ b/src/example.env @@ -1,1665 +1,40 @@ +# Reference: https://github.com/frappe/frappe_docker/blob/main/docs/images-and-compose-files.md +FRAPPE_VERSION=v13.30.0 +# Only with ERPNext override +ERPNEXT_VERSION=v13.31.1 +DB_PASSWORD=123 +# Only if you use external database +DB_HOST= +DB_PORT= +# Only if you use external Redis +REDIS_CACHE= +REDIS_QUEUE= +REDIS_SOCKETIO= +# Only with HTTPS override +LETSENCRYPT_EMAIL=mail@example.com - - - - - - - - - - +# These environment variables are 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`. +FRAPPE_SITE_NAME_HEADER= +# Default value is `127.0.0.1`. Set IP address as our trusted upstream address. +UPSTREAM_REAL_IP_ADDRESS= - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - frappe_docker/example.env at main · frappe/frappe_docker · GitHub - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- Skip to content - - - - - - - - - - -
- -
- - - - - - - -
- - - -
- - - - - - - - - - -
-
-
- - - - - - - - - - - - - - - - - -
- - - - - - -
- - -
- - - - - - - - -Permalink - -
- -
-
- - - main - - - - -
-
-
- Switch branches/tags - -
- - - -
- -
- -
- - -
- -
- - - - - - - - - - - - - - - -
- - -
-
-
-
- -
- -
- - - Go to file - - -
- - - - - -
-
-
- - - - - - - - - -
- -
-
- - - -
-
- github-actions - - - chore: Update example.env - -
- - - - - -
-
- - Latest commit - 38ed43f - May 27, 2022 - - - - - - History - - -
-
- -
- -
-
- - - 2 - - contributors - - -
- -

- Users who have contributed to this file -

-
- - - - - - -
-
- - - @revant - - @vrslev - - - -
-
- - - - - - - - -
- -
- - -
- - 40 lines (29 sloc) - - 1.55 KB -
- -
- - - - -
- - - - - - - -
-
- -
- -
-
- - - -
- - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Reference: https://github.com/frappe/frappe_docker/blob/main/docs/images-and-compose-files.md
-
FRAPPE_VERSION=v13.30.0
-
# Only with ERPNext override
ERPNEXT_VERSION=v13.31.1
-
DB_PASSWORD=123
-
# Only if you use external database
DB_HOST=
DB_PORT=
-
# Only if you use external Redis
REDIS_CACHE=
REDIS_QUEUE=
REDIS_SOCKETIO=
-
# Only with HTTPS override
LETSENCRYPT_EMAIL=mail@example.com
-
# These environment variables are 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`.
FRAPPE_SITE_NAME_HEADER=
-
# Default value is `127.0.0.1`. Set IP address as our trusted upstream address.
UPSTREAM_REAL_IP_ADDRESS=
-
# Default value is `X-Forwarded-For`. Set request header field whose value will be used to replace the client address
UPSTREAM_REAL_IP_HEADER=
-
# Allowed values are on|off. Default value is `off`. If recursive search is disabled,
# the original client address that matches one of the trusted addresses
# is replaced by the last address sent in the request header field defined by the real_ip_header directive.
# If recursive search is enabled, the original client address that matches one of the trusted addresses is replaced by the last non-trusted address sent in the request header field.
UPSTREAM_REAL_IP_RECURSIVE=
-
- - - -
- -
- - - - -
- - -
- - -
-
- - -
- -
- - -
- - -
-
- -
- - - - - - - - - - - - - - - - - - - - +# Default value is `X-Forwarded-For`. Set request header field whose value will be used to replace the client address +UPSTREAM_REAL_IP_HEADER= +# Allowed values are on|off. Default value is `off`. If recursive search is disabled, +# the original client address that matches one of the trusted addresses +# is replaced by the last address sent in the request header field defined by the real_ip_header directive. +# If recursive search is enabled, the original client address that matches one of the trusted addresses is replaced by the last non-trusted address sent in the request header field. +UPSTREAM_REAL_IP_RECURSIVE= \ No newline at end of file diff --git a/src/installation/docker-compose-common.yml b/src/installation/docker-compose-common.yml deleted file mode 100644 index ede3abe..0000000 --- a/src/installation/docker-compose-common.yml +++ /dev/null @@ -1,35 +0,0 @@ -version: '3' - -services: - redis-cache: - image: redis:latest - restart: on-failure - volumes: - - redis-cache-vol:/data - - redis-queue: - image: redis:latest - restart: on-failure - volumes: - - redis-queue-vol:/data - - redis-socketio: - image: redis:latest - restart: on-failure - volumes: - - redis-socketio-vol:/data - - mariadb: - image: mariadb:10.3 - restart: on-failure - environment: - - MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD} - volumes: - - ./frappe-mariadb.cnf:/etc/mysql/conf.d/frappe.cnf - - mariadb-vol:/var/lib/mysql - -volumes: - mariadb-vol: - redis-cache-vol: - redis-queue-vol: - redis-socketio-vol: diff --git a/src/installation/docker-compose-custom.yml b/src/installation/docker-compose-custom.yml deleted file mode 100644 index 9dacfd9..0000000 --- a/src/installation/docker-compose-custom.yml +++ /dev/null @@ -1,123 +0,0 @@ -version: '3' - -services: - [app]-assets: - image: [app]-assets - build: - context: ../build/[app]-nginx - restart: on-failure - environment: - - FRAPPE_PY=[app]-python - - FRAPPE_PY_PORT=8000 - - FRAPPE_SOCKETIO=frappe-socketio - - SOCKETIO_PORT=9000 - - LETSENCRYPT_HOST=${SITES} - - VIRTUAL_HOST=${SITES} - - LETSENCRYPT_EMAIL=${LETSENCRYPT_EMAIL} - depends_on: - - [app]-python - - frappe-socketio - - frappe-worker-default - - frappe-worker-long - - frappe-worker-short - links: - - [app]-python - - frappe-socketio - - frappe-worker-default - - frappe-worker-long - - frappe-worker-short - volumes: - - sites-vol:/var/www/html/sites:rw - - assets-vol:/assets:rw - - [app]-python: - image: [app]-worker - build: - context: ../build/[app]-worker - restart: on-failure - environment: - - MARIADB_HOST=${MARIADB_HOST} - - REDIS_CACHE=redis-cache:6379 - - REDIS_QUEUE=redis-queue:6379 - - REDIS_SOCKETIO=redis-socketio:6379 - - SOCKETIO_PORT=9000 - volumes: - - sites-vol:/home/frappe/frappe-bench/sites:rw - - logs-vol:/home/frappe/frappe-bench/logs:rw - - assets-vol:/home/frappe/frappe-bench/sites/assets:rw - - frappe-socketio: - image: frappe/frappe-socketio:${FRAPPE_VERSION} - restart: on-failure - depends_on: - - redis-socketio - links: - - redis-socketio - volumes: - - sites-vol:/home/frappe/frappe-bench/sites:rw - - logs-vol:/home/frappe/frappe-bench/logs:rw - - frappe-worker-default: - image: [app]-worker - restart: on-failure - command: worker - depends_on: - - redis-queue - - redis-cache - links: - - redis-queue - - redis-cache - volumes: - - sites-vol:/home/frappe/frappe-bench/sites:rw - - logs-vol:/home/frappe/frappe-bench/logs:rw - - frappe-worker-short: - image: [app]-worker - restart: on-failure - command: worker - environment: - - WORKER_TYPE=short - depends_on: - - redis-queue - - redis-cache - links: - - redis-queue - - redis-cache - volumes: - - sites-vol:/home/frappe/frappe-bench/sites:rw - - logs-vol:/home/frappe/frappe-bench/logs:rw - - frappe-worker-long: - image: [app]-worker - restart: on-failure - command: worker - environment: - - WORKER_TYPE=long - depends_on: - - redis-queue - - redis-cache - links: - - redis-queue - - redis-cache - volumes: - - sites-vol:/home/frappe/frappe-bench/sites:rw - - logs-vol:/home/frappe/frappe-bench/logs:rw - - frappe-schedule: - image: [app]-worker - restart: on-failure - command: schedule - depends_on: - - redis-queue - - redis-cache - links: - - redis-queue - - redis-cache - volumes: - - sites-vol:/home/frappe/frappe-bench/sites:rw - - logs-vol:/home/frappe/frappe-bench/logs:rw - -volumes: - assets-vol: - sites-vol: - logs-vol: diff --git a/src/installation/docker-compose-erpnext.yml b/src/installation/docker-compose-erpnext.yml deleted file mode 100644 index 1f769dd..0000000 --- a/src/installation/docker-compose-erpnext.yml +++ /dev/null @@ -1,120 +0,0 @@ -version: '3' - -services: - erpnext-nginx: - image: frappe/erpnext-nginx:${ERPNEXT_VERSION} - restart: on-failure - environment: - - FRAPPE_PY=erpnext-python - - FRAPPE_PY_PORT=8000 - - FRAPPE_SOCKETIO=frappe-socketio - - SOCKETIO_PORT=9000 - - LETSENCRYPT_HOST=${SITES} - - VIRTUAL_HOST=${SITES} - - LETSENCRYPT_EMAIL=${LETSENCRYPT_EMAIL} - depends_on: - - erpnext-python - - frappe-socketio - - frappe-worker-default - - frappe-worker-long - - frappe-worker-short - links: - - erpnext-python - - frappe-socketio - - frappe-worker-default - - frappe-worker-long - - frappe-worker-short - volumes: - - sites-vol:/var/www/html/sites:rw - - assets-vol:/assets:rw - - erpnext-python: - image: frappe/erpnext-worker:${ERPNEXT_VERSION} - restart: on-failure - environment: - - MARIADB_HOST=${MARIADB_HOST} - - REDIS_CACHE=redis-cache:6379 - - REDIS_QUEUE=redis-queue:6379 - - REDIS_SOCKETIO=redis-socketio:6379 - - SOCKETIO_PORT=9000 - - AUTO_MIGRATE=1 - volumes: - - sites-vol:/home/frappe/frappe-bench/sites:rw - - assets-vol:/home/frappe/frappe-bench/sites/assets:rw - - logs-vol:/home/frappe/frappe-bench/logs:rw - - frappe-socketio: - image: frappe/frappe-socketio:${FRAPPE_VERSION} - restart: on-failure - depends_on: - - redis-socketio - links: - - redis-socketio - volumes: - - sites-vol:/home/frappe/frappe-bench/sites:rw - - logs-vol:/home/frappe/frappe-bench/logs:rw - - frappe-worker-default: - image: frappe/erpnext-worker:${ERPNEXT_VERSION} - restart: on-failure - command: worker - depends_on: - - redis-queue - - redis-cache - links: - - redis-queue - - redis-cache - volumes: - - sites-vol:/home/frappe/frappe-bench/sites:rw - - logs-vol:/home/frappe/frappe-bench/logs:rw - - frappe-worker-short: - image: frappe/erpnext-worker:${ERPNEXT_VERSION} - restart: on-failure - command: worker - environment: - - WORKER_TYPE=short - depends_on: - - redis-queue - - redis-cache - links: - - redis-queue - - redis-cache - volumes: - - sites-vol:/home/frappe/frappe-bench/sites:rw - - logs-vol:/home/frappe/frappe-bench/logs:rw - - frappe-worker-long: - image: frappe/erpnext-worker:${ERPNEXT_VERSION} - restart: on-failure - command: worker - environment: - - WORKER_TYPE=long - depends_on: - - redis-queue - - redis-cache - links: - - redis-queue - - redis-cache - volumes: - - sites-vol:/home/frappe/frappe-bench/sites:rw - - logs-vol:/home/frappe/frappe-bench/logs:rw - - frappe-schedule: - image: frappe/erpnext-worker:${ERPNEXT_VERSION} - restart: on-failure - command: schedule - depends_on: - - redis-queue - - redis-cache - links: - - redis-queue - - redis-cache - volumes: - - sites-vol:/home/frappe/frappe-bench/sites:rw - - logs-vol:/home/frappe/frappe-bench/logs:rw - -volumes: - assets-vol: - sites-vol: - logs-vol: diff --git a/src/installation/docker-compose-frappe.yml b/src/installation/docker-compose-frappe.yml deleted file mode 100644 index afd661b..0000000 --- a/src/installation/docker-compose-frappe.yml +++ /dev/null @@ -1,120 +0,0 @@ -version: '3' - -services: - frappe-nginx: - image: frappe/frappe-nginx:${FRAPPE_VERSION} - restart: on-failure - environment: - - FRAPPE_PY=frappe-python - - FRAPPE_PY_PORT=8000 - - FRAPPE_SOCKETIO=frappe-socketio - - SOCKETIO_PORT=9000 - - LETSENCRYPT_HOST=${SITES} - - VIRTUAL_HOST=${SITES} - - LETSENCRYPT_EMAIL=${LETSENCRYPT_EMAIL} - depends_on: - - frappe-python - - frappe-socketio - - frappe-worker-default - - frappe-worker-long - - frappe-worker-short - links: - - frappe-python - - frappe-socketio - - frappe-worker-default - - frappe-worker-long - - frappe-worker-short - volumes: - - sites-vol:/var/www/html/sites:rw - - assets-vol:/assets:rw - - frappe-python: - image: frappe/frappe-worker:${FRAPPE_VERSION} - restart: on-failure - environment: - - MARIADB_HOST=${MARIADB_HOST} - - REDIS_CACHE=redis-cache:6379 - - REDIS_QUEUE=redis-queue:6379 - - REDIS_SOCKETIO=redis-socketio:6379 - - SOCKETIO_PORT=9000 - - AUTO_MIGRATE=1 - volumes: - - sites-vol:/home/frappe/frappe-bench/sites:rw - - logs-vol:/home/frappe/frappe-bench/logs:rw - - assets-vol:/home/frappe/frappe-bench/sites/assets:rw - - frappe-socketio: - image: frappe/frappe-socketio:${FRAPPE_VERSION} - restart: on-failure - depends_on: - - redis-socketio - links: - - redis-socketio - volumes: - - sites-vol:/home/frappe/frappe-bench/sites:rw - - logs-vol:/home/frappe/frappe-bench/logs:rw - - frappe-worker-default: - image: frappe/frappe-worker:${FRAPPE_VERSION} - restart: on-failure - command: worker - depends_on: - - redis-queue - - redis-cache - links: - - redis-queue - - redis-cache - volumes: - - sites-vol:/home/frappe/frappe-bench/sites:rw - - logs-vol:/home/frappe/frappe-bench/logs:rw - - frappe-worker-short: - image: frappe/frappe-worker:${FRAPPE_VERSION} - restart: on-failure - command: worker - environment: - - WORKER_TYPE=short - depends_on: - - redis-queue - - redis-cache - links: - - redis-queue - - redis-cache - volumes: - - sites-vol:/home/frappe/frappe-bench/sites:rw - - logs-vol:/home/frappe/frappe-bench/logs:rw - - frappe-worker-long: - image: frappe/frappe-worker:${FRAPPE_VERSION} - restart: on-failure - command: worker - environment: - - WORKER_TYPE=long - depends_on: - - redis-queue - - redis-cache - links: - - redis-queue - - redis-cache - volumes: - - sites-vol:/home/frappe/frappe-bench/sites:rw - - logs-vol:/home/frappe/frappe-bench/logs:rw - - frappe-schedule: - image: frappe/frappe-worker:${FRAPPE_VERSION} - restart: on-failure - command: schedule - depends_on: - - redis-queue - - redis-cache - links: - - redis-queue - - redis-cache - volumes: - - sites-vol:/home/frappe/frappe-bench/sites:rw - - logs-vol:/home/frappe/frappe-bench/logs:rw - -volumes: - assets-vol: - sites-vol: - logs-vol: \ No newline at end of file diff --git a/src/installation/docker-compose-networks.yml b/src/installation/docker-compose-networks.yml deleted file mode 100644 index 377f01d..0000000 --- a/src/installation/docker-compose-networks.yml +++ /dev/null @@ -1,6 +0,0 @@ -version: '3' - -networks: - default: - external: - name: webproxy diff --git a/src/installation/erpnext-publish.yml b/src/installation/erpnext-publish.yml deleted file mode 100644 index 6975442..0000000 --- a/src/installation/erpnext-publish.yml +++ /dev/null @@ -1,6 +0,0 @@ -version: "3" - -services: - erpnext-nginx: - ports: - - "80:80" diff --git a/src/installation/frappe-mariadb.cnf b/src/installation/frappe-mariadb.cnf deleted file mode 100644 index 83b2c70..0000000 --- a/src/installation/frappe-mariadb.cnf +++ /dev/null @@ -1,7 +0,0 @@ -[mysqld] -character-set-client-handshake = FALSE -character-set-server = utf8mb4 -collation-server = utf8mb4_unicode_ci - -[mysql] -default-character-set = utf8mb4 diff --git a/src/installation/frappe-postgresql/docker-compose.yml b/src/installation/frappe-postgresql/docker-compose.yml deleted file mode 100644 index 8f479aa..0000000 --- a/src/installation/frappe-postgresql/docker-compose.yml +++ /dev/null @@ -1,166 +0,0 @@ -version: "3" - -services: - traefik: - image: "traefik:v2.2" - command: - - "--log.level=DEBUG" - - "--providers.docker=true" - - "--providers.docker.exposedbydefault=false" - - "--entrypoints.web.address=:80" - - "--entrypoints.websecure.address=:443" - - "--certificatesresolvers.myresolver.acme.httpchallenge=true" - - "--certificatesresolvers.myresolver.acme.httpchallenge.entrypoint=web" - - "--certificatesresolvers.myresolver.acme.email=${LETSENCRYPT_EMAIL}" - - "--certificatesresolvers.myresolver.acme.storage=/letsencrypt/acme.json" - labels: - # enable traefik - - "traefik.enable=true" - # global redirect to https for production only - - "${HTTPS_REDIRECT_RULE_LABEL}" - - "${HTTPS_REDIRECT_ENTRYPOINT_LABEL}" - - "${HTTPS_REDIRECT_MIDDLEWARE_LABEL}" - # middleware redirect for production only - - "${HTTPS_USE_REDIRECT_MIDDLEWARE_LABEL}" - ports: - - "80:80" - - "443:443" - volumes: - - cert-vol:/letsencrypt - - /var/run/docker.sock:/var/run/docker.sock:ro - - frappe-nginx: - image: frappe/frappe-nginx:${FRAPPE_VERSION} - restart: on-failure - environment: - - FRAPPE_PY=frappe-python - - FRAPPE_PY_PORT=8000 - - FRAPPE_SOCKETIO=frappe-socketio - - SOCKETIO_PORT=9000 - labels: - - "traefik.enable=true" - - "traefik.http.routers.frappe-nginx.rule=Host(${SITES})" - - "${ENTRYPOINT_LABEL}" - - "${CERT_RESOLVER_LABEL}" - - "traefik.http.services.frappe-nginx.loadbalancer.server.port=80" - volumes: - - sites-vol:/var/www/html/sites:rw - - assets-vol:/assets:rw - - frappe-python: - image: frappe/frappe-worker:${FRAPPE_VERSION} - restart: on-failure - environment: - - POSTGRES_HOST=${POSTGRES_HOST} - - DB_PORT=5432 - - REDIS_CACHE=redis-cache:6379 - - REDIS_QUEUE=redis-queue:6379 - - REDIS_SOCKETIO=redis-socketio:6379 - - SOCKETIO_PORT=9000 - - AUTO_MIGRATE=1 - volumes: - - sites-vol:/home/frappe/frappe-bench/sites:rw - - assets-vol:/home/frappe/frappe-bench/sites/assets:rw - - frappe-socketio: - image: frappe/frappe-socketio:${FRAPPE_VERSION} - restart: on-failure - depends_on: - - redis-socketio - volumes: - - sites-vol:/home/frappe/frappe-bench/sites:rw - - frappe-worker-default: - image: frappe/frappe-worker:${FRAPPE_VERSION} - restart: on-failure - command: worker - depends_on: - - redis-queue - - redis-cache - volumes: - - sites-vol:/home/frappe/frappe-bench/sites:rw - - frappe-worker-short: - image: frappe/frappe-worker:${FRAPPE_VERSION} - restart: on-failure - command: worker - environment: - - WORKER_TYPE=short - depends_on: - - redis-queue - - redis-cache - volumes: - - sites-vol:/home/frappe/frappe-bench/sites:rw - - frappe-worker-long: - image: frappe/frappe-worker:${FRAPPE_VERSION} - restart: on-failure - command: worker - environment: - - WORKER_TYPE=long - depends_on: - - redis-queue - - redis-cache - volumes: - - sites-vol:/home/frappe/frappe-bench/sites:rw - - frappe-schedule: - image: frappe/frappe-worker:${FRAPPE_VERSION} - restart: on-failure - command: schedule - depends_on: - - redis-queue - - redis-cache - volumes: - - sites-vol:/home/frappe/frappe-bench/sites:rw - - redis-cache: - image: redis:latest - restart: on-failure - volumes: - - redis-cache-vol:/data - - redis-queue: - image: redis:latest - restart: on-failure - volumes: - - redis-queue-vol:/data - - redis-socketio: - image: redis:latest - restart: on-failure - volumes: - - redis-socketio-vol:/data - - postgresql: - image: postgres:11.8 - restart: on-failure - environment: - - POSTGRES_PASSWORD=${POSTGRES_PASSWORD} - volumes: - - postgresql-vol:/var/lib/postgresql/data - - site-creator: - image: frappe/frappe-worker:${FRAPPE_VERSION} - restart: "no" - command: new - depends_on: - - frappe-python - environment: - - POSTGRES_HOST=${POSTGRES_HOST} - - SITE_NAME=${SITE_NAME} - - DB_ROOT_USER=${DB_ROOT_USER} - - POSTGRES_PASSWORD=${POSTGRES_PASSWORD} - - ADMIN_PASSWORD=${ADMIN_PASSWORD} - - INSTALL_APPS=${INSTALL_APPS} - volumes: - - sites-vol:/home/frappe/frappe-bench/sites:rw - -volumes: - postgresql-vol: - redis-cache-vol: - redis-queue-vol: - redis-socketio-vol: - assets-vol: - sites-vol: - cert-vol: diff --git a/src/installation/frappe-postgresql/env-local b/src/installation/frappe-postgresql/env-local deleted file mode 100644 index 14a0d12..0000000 --- a/src/installation/frappe-postgresql/env-local +++ /dev/null @@ -1,14 +0,0 @@ -LETSENCRYPT_EMAIL=email@example.com -FRAPPE_VERSION=edge -POSTGRES_HOST=postgresql -POSTGRES_PASSWORD=admin -SITE_NAME=mysite.localhost -SITES=`mysite.localhost` -DB_ROOT_USER=postgres -ADMIN_PASSWORD=admin -ENTRYPOINT_LABEL=traefik.http.routers.erpnext-nginx.entrypoints=web -CERT_RESOLVER_LABEL=erpnext.local.no-cert-resolver -HTTPS_REDIRECT_RULE_LABEL=erpnext.local.no-redirect-rule -HTTPS_REDIRECT_ENTRYPOINT_LABEL=erpnext.local.no-entrypoint -HTTPS_REDIRECT_MIDDLEWARE_LABEL=erpnext.local.no-middleware -HTTPS_USE_REDIRECT_MIDDLEWARE_LABEL=erpnext.local-no-redirect-middleware diff --git a/src/installation/frappe-postgresql/env-production b/src/installation/frappe-postgresql/env-production deleted file mode 100644 index 689f033..0000000 --- a/src/installation/frappe-postgresql/env-production +++ /dev/null @@ -1,14 +0,0 @@ -LETSENCRYPT_EMAIL=email@example.com -FRAPPE_VERSION=edge -POSTGRES_HOST=postgresql -POSTGRES_PASSWORD=admin -SITE_NAME=erp.example.com -SITES=`erp.example.com` -DB_ROOT_USER=postgres -ADMIN_PASSWORD=admin -ENTRYPOINT_LABEL=traefik.http.routers.erpnext-nginx.entrypoints=websecure -CERT_RESOLVER_LABEL=traefik.http.routers.erpnext-nginx.tls.certresolver=myresolver -HTTPS_REDIRECT_RULE_LABEL=traefik.http.routers.http-catchall.rule=hostregexp(`{host:.+}`) -HTTPS_REDIRECT_ENTRYPOINT_LABEL=traefik.http.routers.http-catchall.entrypoints=web -HTTPS_REDIRECT_MIDDLEWARE_LABEL=traefik.http.routers.http-catchall.middlewares=redirect-to-https -HTTPS_USE_REDIRECT_MIDDLEWARE_LABEL=traefik.http.middlewares.redirect-to-https.redirectscheme.scheme=https diff --git a/src/installation/frappe-publish.yml b/src/installation/frappe-publish.yml deleted file mode 100644 index a3f4caa..0000000 --- a/src/installation/frappe-publish.yml +++ /dev/null @@ -1,6 +0,0 @@ -version: "3" - -services: - frappe-nginx: - ports: - - "80:80" diff --git a/src/overrides/compose.noproxy.yaml b/src/overrides/compose.noproxy.yaml index 6a4af81..5c4f83c 100644 --- a/src/overrides/compose.noproxy.yaml +++ b/src/overrides/compose.noproxy.yaml @@ -1,4 +1,4 @@ services: frontend: ports: - - $APP_PORT:8080 + - 8080:8080