Merge pull request #3 from frappe/main

New Update
This commit is contained in:
Antony-M1 2023-12-11 11:19:05 +05:30 committed by GitHub
commit 23ae73653b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
37 changed files with 392 additions and 276 deletions

View file

@ -9,7 +9,7 @@ import sys
from typing import Literal from typing import Literal
Repo = Literal["frappe", "erpnext"] Repo = Literal["frappe", "erpnext"]
MajorVersion = Literal["12", "13", "14", "develop"] MajorVersion = Literal["12", "13", "14", "15", "develop"]
def get_latest_tag(repo: Repo, version: MajorVersion) -> str: def get_latest_tag(repo: Repo, version: MajorVersion) -> str:
@ -57,7 +57,7 @@ def main(_args: list[str]) -> int:
parser = argparse.ArgumentParser() parser = argparse.ArgumentParser()
parser.add_argument("--repo", choices=["frappe", "erpnext"], required=True) parser.add_argument("--repo", choices=["frappe", "erpnext"], required=True)
parser.add_argument( parser.add_argument(
"--version", choices=["12", "13", "14", "develop"], required=True "--version", choices=["12", "13", "14", "15", "develop"], required=True
) )
args = parser.parse_args(_args) args = parser.parse_args(_args)

View file

@ -20,16 +20,16 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v3 uses: actions/checkout@v4
- name: Setup QEMU - name: Setup QEMU
uses: docker/setup-qemu-action@v2 uses: docker/setup-qemu-action@v3
with: with:
image: tonistiigi/binfmt:latest image: tonistiigi/binfmt:latest
platforms: all platforms: all
- name: Setup Buildx - name: Setup Buildx
uses: docker/setup-buildx-action@v2 uses: docker/setup-buildx-action@v3
- name: Set Environment Variables - name: Set Environment Variables
run: cat example.env | grep -o '^[^#]*' >> "$GITHUB_ENV" run: cat example.env | grep -o '^[^#]*' >> "$GITHUB_ENV"
@ -38,20 +38,20 @@ jobs:
run: echo "LATEST_BENCH_RELEASE=$(curl -s 'https://api.github.com/repos/frappe/bench/releases/latest' | jq -r '.tag_name')" >> "$GITHUB_ENV" run: echo "LATEST_BENCH_RELEASE=$(curl -s 'https://api.github.com/repos/frappe/bench/releases/latest' | jq -r '.tag_name')" >> "$GITHUB_ENV"
- name: Build and test - name: Build and test
uses: docker/bake-action@v3.1.0 uses: docker/bake-action@v4.1.0
with: with:
targets: bench-test targets: bench-test
- name: Login - name: Login
if: ${{ github.repository == 'frappe/frappe_docker' && github.event_name != 'pull_request' }} if: ${{ github.repository == 'frappe/frappe_docker' && github.event_name != 'pull_request' }}
uses: docker/login-action@v2 uses: docker/login-action@v3
with: with:
username: ${{ secrets.DOCKERHUB_USERNAME }} username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }} password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Push - name: Push
if: ${{ github.repository == 'frappe/frappe_docker' && github.event_name != 'pull_request' }} if: ${{ github.repository == 'frappe/frappe_docker' && github.event_name != 'pull_request' }}
uses: docker/bake-action@v3.1.0 uses: docker/bake-action@v4.1.0
with: with:
targets: bench targets: bench
push: true push: true

View file

@ -26,8 +26,8 @@ jobs:
repo: erpnext repo: erpnext
version: develop version: develop
push: ${{ github.repository == 'frappe/frappe_docker' && github.event_name != 'pull_request' }} push: ${{ github.repository == 'frappe/frappe_docker' && github.event_name != 'pull_request' }}
python_version: 3.11.4 python_version: 3.11.6
node_version: 18.16.1 node_version: 18.18.2
secrets: secrets:
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }} DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }} DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}

View file

@ -30,26 +30,26 @@ on:
workflow_dispatch: workflow_dispatch:
jobs: jobs:
v13:
uses: ./.github/workflows/docker-build-push.yml
with:
repo: erpnext
version: "13"
push: ${{ github.repository == 'frappe/frappe_docker' && github.event_name != 'pull_request' }}
python_version: 3.9.17
node_version: 14.21.3
secrets:
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}
v14: v14:
uses: ./.github/workflows/docker-build-push.yml uses: ./.github/workflows/docker-build-push.yml
with: with:
repo: erpnext repo: erpnext
version: "14" version: "14"
push: ${{ github.repository == 'frappe/frappe_docker' && github.event_name != 'pull_request' }} push: ${{ github.repository == 'frappe/frappe_docker' && github.event_name != 'pull_request' }}
python_version: 3.10.12 python_version: 3.10.13
node_version: 16.20.1 node_version: 16.20.2
secrets:
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}
v15:
uses: ./.github/workflows/docker-build-push.yml
with:
repo: erpnext
version: "15"
push: ${{ github.repository == 'frappe/frappe_docker' && github.event_name != 'pull_request' }}
python_version: 3.11.6
node_version: 18.18.2
secrets: secrets:
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }} DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }} DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}
@ -58,19 +58,19 @@ jobs:
name: Update example.env and pwd.yml name: Update example.env and pwd.yml
runs-on: ubuntu-latest runs-on: ubuntu-latest
if: ${{ github.repository == 'frappe/frappe_docker' && github.event_name != 'pull_request' }} if: ${{ github.repository == 'frappe/frappe_docker' && github.event_name != 'pull_request' }}
needs: v14 needs: v15
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v3 uses: actions/checkout@v4
- name: Setup Python - name: Setup Python
uses: actions/setup-python@v4 uses: actions/setup-python@v5
with: with:
python-version: "3.10" python-version: "3.10"
- name: Get latest versions - name: Get latest versions
run: python3 ./.github/scripts/get_latest_tags.py --repo erpnext --version 14 run: python3 ./.github/scripts/get_latest_tags.py --repo erpnext --version 15
- name: Update - name: Update
run: | run: |
@ -96,7 +96,7 @@ jobs:
name: Release Helm name: Release Helm
runs-on: ubuntu-latest runs-on: ubuntu-latest
if: ${{ github.repository == 'frappe/frappe_docker' && github.event_name != 'pull_request' }} if: ${{ github.repository == 'frappe/frappe_docker' && github.event_name != 'pull_request' }}
needs: v14 needs: v15
steps: steps:
- name: Setup deploy key - name: Setup deploy key
@ -113,4 +113,4 @@ jobs:
run: | run: |
git clone git@github.com:frappe/helm.git && cd helm git clone git@github.com:frappe/helm.git && cd helm
pip install -r release_wizard/requirements.txt pip install -r release_wizard/requirements.txt
./release_wizard/wizard 14 patch --remote origin --ci ./release_wizard/wizard 15 patch --remote origin --ci

View file

@ -40,10 +40,10 @@ jobs:
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v3 uses: actions/checkout@v4
- name: Setup Buildx - name: Setup Buildx
uses: docker/setup-buildx-action@v2 uses: docker/setup-buildx-action@v3
with: with:
driver-opts: network=host driver-opts: network=host
@ -56,14 +56,14 @@ jobs:
echo "NODE_VERSION=${{ inputs.node_version }}" >> "$GITHUB_ENV" echo "NODE_VERSION=${{ inputs.node_version }}" >> "$GITHUB_ENV"
- name: Build - name: Build
uses: docker/bake-action@v3.1.0 uses: docker/bake-action@v4.1.0
with: with:
push: true push: true
env: env:
REGISTRY_USER: localhost:5000/frappe REGISTRY_USER: localhost:5000/frappe
- name: Setup Python - name: Setup Python
uses: actions/setup-python@v4 uses: actions/setup-python@v5
with: with:
python-version: "3.10" python-version: "3.10"
@ -77,13 +77,13 @@ jobs:
- name: Login - name: Login
if: ${{ inputs.push }} if: ${{ inputs.push }}
uses: docker/login-action@v2 uses: docker/login-action@v3
with: with:
username: ${{ secrets.DOCKERHUB_USERNAME }} username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }} password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Push - name: Push
if: ${{ inputs.push }} if: ${{ inputs.push }}
uses: docker/bake-action@v3.1.0 uses: docker/bake-action@v4.1.0
with: with:
push: true push: true

View file

@ -13,16 +13,16 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v3 uses: actions/checkout@v4
- name: Setup Python - name: Setup Python
uses: actions/setup-python@v4 uses: actions/setup-python@v5
with: with:
python-version: "3.10.6" python-version: "3.10.6"
# For shfmt pre-commit hook # For shfmt pre-commit hook
- name: Setup Go - name: Setup Go
uses: actions/setup-go@v4 uses: actions/setup-go@v5
with: with:
go-version: "^1.14" go-version: "^1.14"

View file

@ -10,7 +10,7 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v3 uses: actions/checkout@v4
- name: Update pre-commit hooks - name: Update pre-commit hooks
uses: vrslev/pre-commit-autoupdate@v1.0.0 uses: vrslev/pre-commit-autoupdate@v1.0.0

View file

@ -1,6 +1,6 @@
repos: repos:
- repo: https://github.com/pre-commit/pre-commit-hooks - repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0 rev: v4.5.0
hooks: hooks:
- id: check-executables-have-shebangs - id: check-executables-have-shebangs
- id: check-shebang-scripts-are-executable - id: check-shebang-scripts-are-executable
@ -8,13 +8,13 @@ repos:
- id: end-of-file-fixer - id: end-of-file-fixer
- repo: https://github.com/asottile/pyupgrade - repo: https://github.com/asottile/pyupgrade
rev: v3.10.1 rev: v3.15.0
hooks: hooks:
- id: pyupgrade - id: pyupgrade
args: [--py37-plus] args: [--py37-plus]
- repo: https://github.com/psf/black - repo: https://github.com/psf/black
rev: 23.7.0 rev: 23.11.0
hooks: hooks:
- id: black - id: black
@ -24,12 +24,12 @@ repos:
- id: isort - id: isort
- repo: https://github.com/pre-commit/mirrors-prettier - repo: https://github.com/pre-commit/mirrors-prettier
rev: v3.0.1 rev: v3.1.0
hooks: hooks:
- id: prettier - id: prettier
- repo: https://github.com/codespell-project/codespell - repo: https://github.com/codespell-project/codespell
rev: v2.2.5 rev: v2.2.6
hooks: hooks:
- id: codespell - id: codespell
args: args:
@ -47,7 +47,7 @@ repos:
types: [shell] types: [shell]
- repo: https://github.com/shellcheck-py/shellcheck-py - repo: https://github.com/shellcheck-py/shellcheck-py
rev: v0.9.0.5 rev: v0.9.0.6
hooks: hooks:
- id: shellcheck - id: shellcheck
args: [-x] args: [-x]

View file

@ -20,6 +20,7 @@ services:
entrypoint: entrypoint:
- bash - bash
- -c - -c
# add redis_socketio for backward compatibility
command: command:
- > - >
ls -1 apps > sites/apps.txt; ls -1 apps > sites/apps.txt;
@ -27,14 +28,13 @@ services:
bench set-config -gp db_port $$DB_PORT; bench set-config -gp db_port $$DB_PORT;
bench set-config -g redis_cache "redis://$$REDIS_CACHE"; bench set-config -g redis_cache "redis://$$REDIS_CACHE";
bench set-config -g redis_queue "redis://$$REDIS_QUEUE"; bench set-config -g redis_queue "redis://$$REDIS_QUEUE";
bench set-config -g redis_socketio "redis://$$REDIS_SOCKETIO"; bench set-config -g redis_socketio "redis://$$REDIS_QUEUE";
bench set-config -gp socketio_port $$SOCKETIO_PORT; bench set-config -gp socketio_port $$SOCKETIO_PORT;
environment: environment:
DB_HOST: ${DB_HOST} DB_HOST: ${DB_HOST}
DB_PORT: ${DB_PORT} DB_PORT: ${DB_PORT}
REDIS_CACHE: ${REDIS_CACHE} REDIS_CACHE: ${REDIS_CACHE}
REDIS_QUEUE: ${REDIS_QUEUE} REDIS_QUEUE: ${REDIS_QUEUE}
REDIS_SOCKETIO: ${REDIS_SOCKETIO}
SOCKETIO_PORT: 9000 SOCKETIO_PORT: 9000
depends_on: {} depends_on: {}
@ -70,15 +70,11 @@ services:
queue-short: queue-short:
<<: *backend_defaults <<: *backend_defaults
command: bench worker --queue short command: bench worker --queue short,default
queue-default:
<<: *backend_defaults
command: bench worker --queue default
queue-long: queue-long:
<<: *backend_defaults <<: *backend_defaults
command: bench worker --queue long command: bench worker --queue long,default,short
scheduler: scheduler:
<<: *backend_defaults <<: *backend_defaults

View file

@ -1,7 +1,7 @@
version: "3.7" version: "3.7"
services: services:
mariadb: mariadb:
image: mariadb:10.6 image: docker.io/mariadb:10.6
command: command:
- --character-set-server=utf8mb4 - --character-set-server=utf8mb4
- --collation-server=utf8mb4_unicode_ci - --collation-server=utf8mb4_unicode_ci
@ -20,17 +20,29 @@ services:
# volumes: # volumes:
# - postgresql-data:/var/lib/postgresql/data # - postgresql-data:/var/lib/postgresql/data
# Enable Mailpit if you need to test outgoing mail services
# See https://mailpit.axllent.org/
# mailpit:
# image: axllent/mailpit
# volumes:
# - mailpit-data:/data
# ports:
# - 8025:8025
# - 1025:1025
# environment:
# MP_MAX_MESSAGES: 5000
# MP_DATA_FILE: /data/mailpit.db
# MP_SMTP_AUTH_ACCEPT_ANY: 1
# MP_SMTP_AUTH_ALLOW_INSECURE: 1
redis-cache: redis-cache:
image: redis:alpine image: docker.io/redis:alpine
redis-queue: redis-queue:
image: redis:alpine image: docker.io/redis:alpine
redis-socketio:
image: redis:alpine
frappe: frappe:
image: frappe/bench:latest image: docker.io/frappe/bench:latest
command: sleep infinity command: sleep infinity
environment: environment:
- SHELL=/bin/bash - SHELL=/bin/bash
@ -42,7 +54,34 @@ services:
ports: ports:
- 8000-8005:8000-8005 - 8000-8005:8000-8005
- 9000-9005:9000-9005 - 9000-9005:9000-9005
# enable the below service if you need Cypress UI Tests to be executed
# Before enabling ensure install_x11_deps.sh has been executed and display variable is exported.
# Run install_x11_deps.sh again if DISPLAY is not set
# ui-tester:
# # pass custom command to start Cypress otherwise it will use the entrypoint
# # specified in the Cypress Docker image.
# # also pass "--project <folder>" so that when Cypress opens
# # it can find file "cypress.json" and show integration specs
# # https://on.cypress.io/command-line#cypress-open
# entrypoint: 'sleep infinity'
# image: "docker.io/cypress/included:latest"
# environment:
# - SHELL=/bin/bash
# # get the IP address of the host machine and allow X11 to accept
# # incoming connections from that IP address
# # IP=$(ipconfig getifaddr en0) or mac or \
# # IP=$($(hostname -I | awk '{print $1}') ) for Ubuntu
# # /usr/X11/bin/xhost + $IP
# # then pass the environment variable DISPLAY to show Cypress GUI on the host system
# # DISPLAY=$IP:0
# - DISPLAY
# volumes:
# # for Cypress to communicate with the X11 server pass this socket file
# # in addition to any other mapped volumes
# - /tmp/.X11-unix:/tmp/.X11-unix
# - ..:/workspace:z,cached
# network_mode: "host"
volumes: volumes:
mariadb-data: mariadb-data:
postgresql-data: #postgresql-data:
#mailpit-data:

View file

@ -1,6 +1,6 @@
[ [
{ {
"url": "https://github.com/frappe/erpnext.git", "url": "https://github.com/frappe/erpnext.git",
"branch": "version-14" "branch": "version-15"
} }
] ]

View file

@ -72,8 +72,8 @@ def get_args_parser():
"--frappe-branch", "--frappe-branch",
action="store", action="store",
type=str, type=str,
help="frappe repo to use, default: version-14", # noqa: E501 help="frappe repo to use, default: version-15", # noqa: E501
default="version-14", default="version-15",
) )
parser.add_argument( parser.add_argument(
"-p", "-p",
@ -97,6 +97,22 @@ def get_args_parser():
action="store_true", action="store_true",
help="verbose output", # noqa: E501 help="verbose output", # noqa: E501
) )
parser.add_argument(
"-a",
"--admin-password",
action="store",
type=str,
help="admin password for site, default: admin", # noqa: E501
default="admin",
)
parser.add_argument(
"-d",
"--db-type",
action="store",
type=str,
help="Database type to use (e.g., mariadb or postgres)",
default="mariadb", # Set your default database type here
)
return parser return parser
@ -104,7 +120,6 @@ def init_bench_if_not_exist(args):
if os.path.exists(args.bench_name): if os.path.exists(args.bench_name):
cprint("Bench already exists. Only site will be created", level=3) cprint("Bench already exists. Only site will be created", level=3)
return return
try: try:
env = os.environ.copy() env = os.environ.copy()
if args.py_version: if args.py_version:
@ -129,11 +144,14 @@ def init_bench_if_not_exist(args):
] ]
subprocess.call(command, env=env, cwd=os.getcwd()) subprocess.call(command, env=env, cwd=os.getcwd())
cprint("Configuring Bench ...", level=2) cprint("Configuring Bench ...", level=2)
cprint("Set db_host to mariadb", level=3) cprint("Set db_host", level=3)
if args.db_type:
cprint(f"Setting db_type to {args.db_type}", level=3)
subprocess.call( subprocess.call(
["bench", "set-config", "-g", "db_host", "mariadb"], ["bench", "set-config", "-g", "db_type", args.db_type],
cwd=os.getcwd() + "/" + args.bench_name, cwd=os.path.join(os.getcwd(), args.bench_name),
) )
cprint("Set redis_cache to redis://redis-cache:6379", level=3) cprint("Set redis_cache to redis://redis-cache:6379", level=3)
subprocess.call( subprocess.call(
[ [
@ -156,14 +174,17 @@ def init_bench_if_not_exist(args):
], ],
cwd=os.getcwd() + "/" + args.bench_name, cwd=os.getcwd() + "/" + args.bench_name,
) )
cprint("Set redis_socketio to redis://redis-socketio:6379", level=3) cprint(
"Set redis_socketio to redis://redis-queue:6379 for backward compatibility", # noqa: E501
level=3,
)
subprocess.call( subprocess.call(
[ [
"bench", "bench",
"set-config", "set-config",
"-g", "-g",
"redis_socketio", "redis_socketio",
"redis://redis-socketio:6379", "redis://redis-queue:6379",
], ],
cwd=os.getcwd() + "/" + args.bench_name, cwd=os.getcwd() + "/" + args.bench_name,
) )
@ -177,20 +198,41 @@ def init_bench_if_not_exist(args):
def create_site_in_bench(args): def create_site_in_bench(args):
if "mariadb" == args.db_type:
cprint("Set db_host", level=3)
subprocess.call(
["bench", "set-config", "-g", "db_host", "mariadb"],
cwd=os.getcwd() + "/" + args.bench_name,
)
new_site_cmd = [ new_site_cmd = [
"bench", "bench",
"new-site", "new-site",
"--no-mariadb-socket", f"--db-host=mariadb", # Should match the compose service name
"--mariadb-root-password=123", f"--db-type={args.db_type}", # Add the selected database type
"--admin-password=admin", f"--no-mariadb-socket",
f"--db-root-password=123", # Replace with your MariaDB password
f"--admin-password={args.admin_password}",
]
else:
cprint("Set db_host", level=3)
subprocess.call(
["bench", "set-config", "-g", "db_host", "postgresql"],
cwd=os.getcwd() + "/" + args.bench_name,
)
new_site_cmd = [
"bench",
"new-site",
f"--db-host=postgresql", # Should match the compose service name
f"--db-type={args.db_type}", # Add the selected database type
f"--db-root-password=123", # Replace with your PostgreSQL password
f"--admin-password={args.admin_password}",
] ]
apps = os.listdir(f"{os.getcwd()}/{args.bench_name}/apps") apps = os.listdir(f"{os.getcwd()}/{args.bench_name}/apps")
apps.remove("frappe") apps.remove("frappe")
for app in apps: for app in apps:
new_site_cmd.append(f"--install-app={app}") new_site_cmd.append(f"--install-app={app}")
new_site_cmd.append(args.site_name) new_site_cmd.append(args.site_name)
cprint(f"Creating Site {args.site_name} ...", level=2)
subprocess.call( subprocess.call(
new_site_cmd, new_site_cmd,
cwd=os.getcwd() + "/" + args.bench_name, cwd=os.getcwd() + "/" + args.bench_name,

View file

@ -23,18 +23,6 @@
"DEV_SERVER": "1" "DEV_SERVER": "1"
} }
}, },
{
"name": "Bench Default Worker",
"type": "python",
"request": "launch",
"program": "${workspaceFolder}/frappe-bench/apps/frappe/frappe/utils/bench_helper.py",
"args": ["frappe", "worker", "--queue", "default"],
"pythonPath": "${workspaceFolder}/frappe-bench/env/bin/python",
"cwd": "${workspaceFolder}/frappe-bench/sites",
"env": {
"DEV_SERVER": "1"
}
},
{ {
"name": "Bench Short Worker", "name": "Bench Short Worker",
"type": "python", "type": "python",

View file

@ -6,10 +6,10 @@ variable "REGISTRY_USER" {
} }
variable PYTHON_VERSION { variable PYTHON_VERSION {
default = "3.11.4" default = "3.11.6"
} }
variable NODE_VERSION { variable NODE_VERSION {
default = "18.16.1" default = "18.18.2"
} }
variable "FRAPPE_VERSION" { variable "FRAPPE_VERSION" {

View file

@ -70,6 +70,8 @@ Notes:
Run the following commands in the terminal inside the container. You might need to create a new terminal in VSCode. Run the following commands in the terminal inside the container. You might need to create a new terminal in VSCode.
NOTE: Prior to doing the following, make sure the user is **frappe**.
```shell ```shell
bench init --skip-redis-config-generation frappe-bench bench init --skip-redis-config-generation frappe-bench
cd frappe-bench cd frappe-bench
@ -82,12 +84,12 @@ To setup frappe framework version 14 bench set `PYENV_VERSION` environment varia
bench init --skip-redis-config-generation --frappe-branch version-14 frappe-bench bench init --skip-redis-config-generation --frappe-branch version-14 frappe-bench
# Or set environment versions explicitly # Or set environment versions explicitly
nvm use v16 nvm use v16
PYENV_VERSION=3.10.12 bench init --skip-redis-config-generation --frappe-branch version-14 frappe-bench PYENV_VERSION=3.10.13 bench init --skip-redis-config-generation --frappe-branch version-14 frappe-bench
# Switch directory # Switch directory
cd frappe-bench cd frappe-bench
``` ```
To setup frappe framework version 13 bench set `PYENV_VERSION` environment variable to `3.9.9` and use NodeJS version 14, To setup frappe framework version 13 bench set `PYENV_VERSION` environment variable to `3.9.17` and use NodeJS version 14,
```shell ```shell
nvm use v14 nvm use v14
@ -103,7 +105,7 @@ We need to tell bench to use the right containers instead of localhost. Run the
bench set-config -g db_host mariadb bench set-config -g db_host mariadb
bench set-config -g redis_cache redis://redis-cache:6379 bench set-config -g redis_cache redis://redis-cache:6379
bench set-config -g redis_queue redis://redis-queue:6379 bench set-config -g redis_queue redis://redis-queue:6379
bench set-config -g redis_socketio redis://redis-socketio:6379 bench set-config -g redis_socketio redis://redis-queue:6379
``` ```
For any reason the above commands fail, set the values in `common_site_config.json` manually. For any reason the above commands fail, set the values in `common_site_config.json` manually.
@ -113,7 +115,7 @@ For any reason the above commands fail, set the values in `common_site_config.js
"db_host": "mariadb", "db_host": "mariadb",
"redis_cache": "redis://redis-cache:6379", "redis_cache": "redis://redis-cache:6379",
"redis_queue": "redis://redis-queue:6379", "redis_queue": "redis://redis-queue:6379",
"redis_socketio": "redis://redis-socketio:6379" "redis_socketio": "redis://redis-queue:6379"
} }
``` ```
@ -142,7 +144,7 @@ sed -i '/redis/d' ./Procfile
You can create a new site with the following command: You can create a new site with the following command:
```shell ```shell
bench new-site sitename --no-mariadb-socket bench new-site --no-mariadb-socket sitename
``` ```
sitename MUST end with .localhost for trying deployments locally. sitename MUST end with .localhost for trying deployments locally.
@ -150,13 +152,13 @@ sitename MUST end with .localhost for trying deployments locally.
for example: for example:
```shell ```shell
bench new-site development.localhost --no-mariadb-socket bench new-site --no-mariadb-socket development.localhost
``` ```
The same command can be run non-interactively as well: The same command can be run non-interactively as well:
```shell ```shell
bench new-site development.localhost --mariadb-root-password 123 --admin-password admin --no-mariadb-socket bench new-site --mariadb-root-password 123 --admin-password admin --no-mariadb-socket development.localhost
``` ```
The command will ask the MariaDB root password. The default root password is `123`. The command will ask the MariaDB root password. The default root password is `123`.
@ -169,7 +171,7 @@ To setup site with PostgreSQL as database use option `--db-type postgres` and `-
Example: Example:
```shell ```shell
bench new-site mypgsql.localhost --db-type postgres --db-host postgresql bench new-site --db-type postgres --db-host postgresql mypgsql.localhost
``` ```
To avoid entering postgresql username and root password, set it in `common_site_config.json`, To avoid entering postgresql username and root password, set it in `common_site_config.json`,
@ -236,21 +238,21 @@ Note: To start bench with debugger refer section for debugging.
Most developers work with numerous clients and versions. Moreover, apps may be required to be installed by everyone on the team working for a client. Most developers work with numerous clients and versions. Moreover, apps may be required to be installed by everyone on the team working for a client.
This is simplified using a script to automate the process of creating a new bench / site and installing the required apps. This is simplified using a script to automate the process of creating a new bench / site and installing the required apps. `Administrator` password is for created sites is `admin`.
Sample `apps-example.json` is used by default, it installs erpnext on current stable release. To install custom apps, copy the `apps-example.json` to custom json file and make changes to list of apps. Pass this file to the `installer.py` script. Sample `apps-example.json` is used by default, it installs erpnext on current stable release. To install custom apps, copy the `apps-example.json` to custom json file and make changes to list of apps. Pass this file to the `installer.py` script.
> You may have apps in private repos which may require ssh access. You may use SSH from your home directory on linux (configurable in docker-compose.yml). > You may have apps in private repos which may require ssh access. You may use SSH from your home directory on linux (configurable in docker-compose.yml).
```shell ```shell
python installer.py python installer.py #pass --db-type postgres for postgresdb
``` ```
For command help For command help
```shell ```shell
python installer.py --help python installer.py --help
usage: installer.py [-h] [-j APPS_JSON] [-b BENCH_NAME] [-s SITE_NAME] [-r FRAPPE_REPO] [-t FRAPPE_BRANCH] [-p PY_VERSION] [-n NODE_VERSION] [-v] usage: installer.py [-h] [-j APPS_JSON] [-b BENCH_NAME] [-s SITE_NAME] [-r FRAPPE_REPO] [-t FRAPPE_BRANCH] [-p PY_VERSION] [-n NODE_VERSION] [-v] [-a ADMIN_PASSWORD] [-d DB_TYPE]
options: options:
-h, --help show this help message and exit -h, --help show this help message and exit
@ -263,12 +265,16 @@ options:
-r FRAPPE_REPO, --frappe-repo FRAPPE_REPO -r FRAPPE_REPO, --frappe-repo FRAPPE_REPO
frappe repo to use, default: https://github.com/frappe/frappe frappe repo to use, default: https://github.com/frappe/frappe
-t FRAPPE_BRANCH, --frappe-branch FRAPPE_BRANCH -t FRAPPE_BRANCH, --frappe-branch FRAPPE_BRANCH
frappe repo to use, default: version-14 frappe repo to use, default: version-15
-p PY_VERSION, --py-version PY_VERSION -p PY_VERSION, --py-version PY_VERSION
python version, default: Not Set python version, default: Not Set
-n NODE_VERSION, --node-version NODE_VERSION -n NODE_VERSION, --node-version NODE_VERSION
node version, default: Not Set node version, default: Not Set
-v, --verbose verbose output -v, --verbose verbose output
-a ADMIN_PASSWORD, --admin-password ADMIN_PASSWORD
admin password for site, default: admin
-d DB_TYPE, --db-type DB_TYPE
Database type to use (e.g., mariadb or postgres)
``` ```
A new bench and / or site is created for the client with following defaults. A new bench and / or site is created for the client with following defaults.
@ -276,6 +282,8 @@ A new bench and / or site is created for the client with following defaults.
- MariaDB root password: `123` - MariaDB root password: `123`
- Admin password: `admin` - Admin password: `admin`
> To use Postegres DB, comment the mariabdb service and uncomment postegres service.
### Start Frappe with Visual Studio Code Python Debugging ### Start Frappe with Visual Studio Code Python Debugging
To enable Python debugging inside Visual Studio Code, you must first install the `ms-python.python` extension inside the container. This should have already happened automatically, but depending on your VSCode config, you can force it by: To enable Python debugging inside Visual Studio Code, you must first install the `ms-python.python` extension inside the container. This should have already happened automatically, but depending on your VSCode config, you can force it by:
@ -293,8 +301,7 @@ honcho start \
watch \ watch \
schedule \ schedule \
worker_short \ worker_short \
worker_long \ worker_long
worker_default
``` ```
Alternatively you can use the VSCode launch configuration "Honcho SocketIO Watch Schedule Worker" which launches the same command as above. Alternatively you can use the VSCode launch configuration "Honcho SocketIO Watch Schedule Worker" which launches the same command as above.
@ -381,3 +388,30 @@ volumes:
``` ```
Access the service by service name from the `frappe` development container. The above service will be accessible via hostname `postgresql`. If ports are published on to host, access it via `localhost:5432`. Access the service by service name from the `frappe` development container. The above service will be accessible via hostname `postgresql`. If ports are published on to host, access it via `localhost:5432`.
## Using Cypress UI tests
To run cypress based UI tests in a docker environment, follow the below steps:
1. Install and setup X11 tooling on VM using the script `install_x11_deps.sh`
```shell
sudo bash ./install_x11_deps.sh
```
This script will install required deps, enable X11Forwarding and restart SSH daemon and export `DISPLAY` variable.
2. Run X11 service `startx` or `xquartz`
3. Start docker compose services.
4. SSH into ui-tester service using `docker exec..` command
5. Export CYPRESS_baseUrl and other required env variables
6. Start Cypress UI console by issuing `cypress run command`
> More references : [Cypress Official Documentation](https://www.cypress.io/blog/2019/05/02/run-cypress-with-a-single-docker-command)
> Ensure DISPLAY environment is always exported.
## Using Mailpit to test mail services
To use Mailpit just uncomment the service in the docker-compose.yml file.
The Interface is then available under port 8025 and the smtp service can be used as mailpit:1025.

View file

@ -39,11 +39,7 @@ Hostname for redis server to store cache. Set only if external service for redis
### `REDIS_QUEUE` ### `REDIS_QUEUE`
Hostname for redis server to store queue data. Set only if external service for redis is used. Hostname for redis server to store queue data and socketio. 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_VERSION`

View file

@ -30,7 +30,7 @@ All services are described in `compose.yaml`
- `frontend`. [nginx](https://www.nginx.com) server that serves JS/CSS assets and routes incoming requests. - `frontend`. [nginx](https://www.nginx.com) server that serves JS/CSS assets and routes incoming requests.
- `proxy`. [Traefik](https://traefik.io/traefik/) proxy. It is here for complicated setups or HTTPS override (with `overrides/compose.https.yaml`). - `proxy`. [Traefik](https://traefik.io/traefik/) proxy. It is here for complicated setups or HTTPS override (with `overrides/compose.https.yaml`).
- `websocket`. Node server that runs [Socket.IO](https://socket.io). - `websocket`. Node server that runs [Socket.IO](https://socket.io).
- `queue-short`, `queue-default`, `queue-long`. Python servers that run job queues using [rq](https://python-rq.org). - `queue-short`, `queue-long`. Python servers that run job queues using [rq](https://python-rq.org).
- `scheduler`. Python server that runs tasks on schedule using [schedule](https://schedule.readthedocs.io/en/stable/). - `scheduler`. Python server that runs tasks on schedule using [schedule](https://schedule.readthedocs.io/en/stable/).
## Overrides ## Overrides

View file

@ -62,14 +62,12 @@ configurator:
bench set-config -gp db_port $$DB_PORT; bench set-config -gp db_port $$DB_PORT;
bench set-config -g redis_cache "redis://$$REDIS_CACHE"; bench set-config -g redis_cache "redis://$$REDIS_CACHE";
bench set-config -g redis_queue "redis://$$REDIS_QUEUE"; 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; bench set-config -gp socketio_port $$SOCKETIO_PORT;
environment: environment:
DB_HOST: db DB_HOST: db
DB_PORT: "3306" DB_PORT: "3306"
REDIS_CACHE: redis-cache:6379 REDIS_CACHE: redis-cache:6379
REDIS_QUEUE: redis-queue:6379 REDIS_QUEUE: redis-queue:6379
REDIS_SOCKETIO: redis-socketio:6379
SOCKETIO_PORT: "9000" SOCKETIO_PORT: "9000"
# ... removed for brevity # ... removed for brevity
``` ```
@ -95,7 +93,6 @@ create-site:
wait-for-it -t 120 db:3306; wait-for-it -t 120 db:3306;
wait-for-it -t 120 redis-cache:6379; wait-for-it -t 120 redis-cache:6379;
wait-for-it -t 120 redis-queue:6379; wait-for-it -t 120 redis-queue:6379;
wait-for-it -t 120 redis-socketio:6379;
export start=`date +%s`; export start=`date +%s`;
until [[ -n `grep -hs ^ sites/common_site_config.json | jq -r ".db_host // empty"` ]] && \ 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_cache // empty"` ]] && \
@ -109,7 +106,7 @@ create-site:
fi fi
done; done;
echo "sites/common_site_config.json found"; echo "sites/common_site_config.json found";
bench new-site frontend --no-mariadb-socket --admin-password=admin --db-root-password=admin --install-app erpnext --set-default; bench new-site --no-mariadb-socket --admin-password=admin --db-root-password=admin --install-app erpnext --set-default frontend;
# ... removed for brevity # ... removed for brevity
``` ```

View file

@ -40,8 +40,7 @@ Instead of `docker compose config`, you can directly use `docker compose up` to
### Setup Frappe without proxy and external MariaDB and Redis ### Setup Frappe without proxy and external MariaDB and Redis
In this case make sure you've set `DB_HOST`, `DB_PORT`, `REDIS_CACHE`, `REDIS_QUEUE` and `REDIS_SOCKETIO` In this case make sure you've set `DB_HOST`, `DB_PORT`, `REDIS_CACHE` and `REDIS_QUEUE` environment variables or the `configurator` will fail.
environment variables or the `configurator` will fail.
```sh ```sh
# Generate YAML # Generate YAML
@ -53,8 +52,7 @@ docker compose --project-name <project-name> -f ~/gitops/docker-compose.yml up -
### Setup ERPNext with proxy and external MariaDB and Redis ### Setup ERPNext with proxy and external MariaDB and Redis
In this case make sure you've set `DB_HOST`, `DB_PORT`, `REDIS_CACHE`, `REDIS_QUEUE` and `REDIS_SOCKETIO` In this case make sure you've set `DB_HOST`, `DB_PORT`, `REDIS_CACHE` and `REDIS_QUEUE` environment variables or the `configurator` will fail.
environment variables or the `configurator` will fail.
```sh ```sh
# Generate YAML # Generate YAML

View file

@ -15,7 +15,7 @@ version: "3"
services: services:
backend: backend:
image: frappe/erpnext:v14.27.1 image: frappe/erpnext:v14
platform: linux/amd64 platform: linux/amd64
deploy: deploy:
restart_policy: restart_policy:
@ -25,7 +25,7 @@ services:
- logs:/home/frappe/frappe-bench/logs - logs:/home/frappe/frappe-bench/logs
configurator: configurator:
image: frappe/erpnext:v14.27.1 image: frappe/erpnext:v14
platform: linux/amd64 platform: linux/amd64
deploy: deploy:
restart_policy: restart_policy:
@ -40,21 +40,19 @@ services:
bench set-config -gp db_port $$DB_PORT; bench set-config -gp db_port $$DB_PORT;
bench set-config -g redis_cache "redis://$$REDIS_CACHE"; bench set-config -g redis_cache "redis://$$REDIS_CACHE";
bench set-config -g redis_queue "redis://$$REDIS_QUEUE"; 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; bench set-config -gp socketio_port $$SOCKETIO_PORT;
environment: environment:
DB_HOST: db DB_HOST: db
DB_PORT: "3306" DB_PORT: "3306"
REDIS_CACHE: redis-cache:6379 REDIS_CACHE: redis-cache:6379
REDIS_QUEUE: redis-queue:6379 REDIS_QUEUE: redis-queue:6379
REDIS_SOCKETIO: redis-socketio:6379
SOCKETIO_PORT: "9000" SOCKETIO_PORT: "9000"
volumes: volumes:
- sites:/home/frappe/frappe-bench/sites - sites:/home/frappe/frappe-bench/sites
- logs:/home/frappe/frappe-bench/logs - logs:/home/frappe/frappe-bench/logs
create-site: create-site:
image: frappe/erpnext:v14.27.1 image: frappe/erpnext:v14
platform: linux/amd64 platform: linux/amd64
deploy: deploy:
restart_policy: restart_policy:
@ -70,7 +68,6 @@ services:
wait-for-it -t 120 db:3306; wait-for-it -t 120 db:3306;
wait-for-it -t 120 redis-cache:6379; wait-for-it -t 120 redis-cache:6379;
wait-for-it -t 120 redis-queue:6379; wait-for-it -t 120 redis-queue:6379;
wait-for-it -t 120 redis-socketio:6379;
export start=`date +%s`; export start=`date +%s`;
until [[ -n `grep -hs ^ sites/common_site_config.json | jq -r ".db_host // empty"` ]] && \ 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_cache // empty"` ]] && \
@ -84,7 +81,7 @@ services:
fi fi
done; done;
echo "sites/common_site_config.json found"; echo "sites/common_site_config.json found";
bench new-site frontend --no-mariadb-socket --admin-password=admin --db-root-password=admin --install-app erpnext --set-default; bench new-site --no-mariadb-socket --admin-password=admin --db-root-password=admin --install-app erpnext --set-default frontend;
db: db:
image: mariadb:10.6 image: mariadb:10.6
@ -107,7 +104,7 @@ services:
- db-data:/var/lib/mysql - db-data:/var/lib/mysql
frontend: frontend:
image: frappe/erpnext:v14.27.1 image: frappe/erpnext:v14
platform: linux/amd64 platform: linux/amd64
deploy: deploy:
restart_policy: restart_policy:
@ -129,23 +126,8 @@ services:
ports: ports:
- "8080:8080" - "8080:8080"
queue-default:
image: frappe/erpnext:v14.27.1
platform: linux/amd64
deploy:
restart_policy:
condition: on-failure
command:
- bench
- worker
- --queue
- default
volumes:
- sites:/home/frappe/frappe-bench/sites
- logs:/home/frappe/frappe-bench/logs
queue-long: queue-long:
image: frappe/erpnext:v14.27.1 image: frappe/erpnext:v14
platform: linux/amd64 platform: linux/amd64
deploy: deploy:
restart_policy: restart_policy:
@ -160,7 +142,7 @@ services:
- logs:/home/frappe/frappe-bench/logs - logs:/home/frappe/frappe-bench/logs
queue-short: queue-short:
image: frappe/erpnext:v14.27.1 image: frappe/erpnext:v14
platform: linux/amd64 platform: linux/amd64
deploy: deploy:
restart_policy: restart_policy:
@ -192,17 +174,8 @@ services:
volumes: volumes:
- redis-cache-data:/data - redis-cache-data:/data
redis-socketio:
image: redis:6.2-alpine
platform: linux/amd64
deploy:
restart_policy:
condition: on-failure
volumes:
- redis-socketio-data:/data
scheduler: scheduler:
image: frappe/erpnext:v14.27.1 image: frappe/erpnext:v14
platform: linux/amd64 platform: linux/amd64
deploy: deploy:
restart_policy: restart_policy:
@ -215,7 +188,7 @@ services:
- logs:/home/frappe/frappe-bench/logs - logs:/home/frappe/frappe-bench/logs
websocket: websocket:
image: frappe/erpnext:v14.27.1 image: frappe/erpnext:v14
platform: linux/amd64 platform: linux/amd64
deploy: deploy:
restart_policy: restart_policy:
@ -231,13 +204,16 @@ volumes:
db-data: db-data:
redis-queue-data: redis-queue-data:
redis-cache-data: redis-cache-data:
redis-socketio-data:
sites: sites:
logs: logs:
``` ```
step3: run the docker step3: run the docker
```
cd frappe_docker
```
``` ```
docker-compose -f ./pwd.yml up docker-compose -f ./pwd.yml up
``` ```

View file

@ -8,9 +8,8 @@ This setup is a very simple single compose file that does everything to start re
- backend, serves gunicorn backend - backend, serves gunicorn backend
- frontend, serves static assets through nginx frontend reverse proxies websocket and gunicorn. - frontend, serves static assets through nginx frontend reverse proxies websocket and gunicorn.
- queue-default, default rq worker. - queue-long, long default and short rq worker.
- queue-long, long rq worker. - queue-short, default and short rq worker.
- queue-short, short rq worker.
- schedule, event scheduler. - schedule, event scheduler.
- websocket, socketio websocket for realtime communication. - websocket, socketio websocket for realtime communication.
@ -23,8 +22,7 @@ This setup is a very simple single compose file that does everything to start re
- db, mariadb, container with frappe specific configuration. - db, mariadb, container with frappe specific configuration.
- redis-cache, redis for cache data. - redis-cache, redis for cache data.
- redis-queue, redis for rq data. - redis-queue, redis for rq data and pub/sub.
- redis-socketio, redis for socketio pubsub.
## Volumes ## Volumes

View file

@ -41,7 +41,7 @@ chmod +x $DOCKER_CONFIG/cli-plugins/docker-compose
### Prepare ### Prepare
Clone `frappe_docker` repo for the needed YAMLs and change the current working director of you shell to the cloned repo. Clone `frappe_docker` repo for the needed YAMLs and change the current working directory of your shell to the cloned repo.
```shell ```shell
git clone https://github.com/frappe/frappe_docker git clone https://github.com/frappe/frappe_docker
@ -175,7 +175,7 @@ Create sites `one.example.com` and `two.example.com`:
```shell ```shell
# one.example.com # one.example.com
docker compose --project-name erpnext-one exec backend \ docker compose --project-name erpnext-one exec backend \
bench new-site one.example.com --no-mariadb-socket --mariadb-root-password changeit --install-app erpnext --admin-password changeit bench new-site --no-mariadb-socket --mariadb-root-password changeit --install-app erpnext --admin-password changeit one.example.com
``` ```
You can stop here and have a single bench single site setup complete. Continue to add one more site to the current bench. You can stop here and have a single bench single site setup complete. Continue to add one more site to the current bench.
@ -183,7 +183,7 @@ You can stop here and have a single bench single site setup complete. Continue t
```shell ```shell
# two.example.com # two.example.com
docker compose --project-name erpnext-one exec backend \ docker compose --project-name erpnext-one exec backend \
bench new-site two.example.com --no-mariadb-socket --mariadb-root-password changeit --install-app erpnext --admin-password changeit bench new-site --no-mariadb-socket --mariadb-root-password changeit --install-app erpnext --admin-password changeit two.example.com
``` ```
#### Create second bench #### Create second bench
@ -234,10 +234,10 @@ Create sites `three.example.com` and `four.example.com`:
```shell ```shell
# three.example.com # three.example.com
docker compose --project-name erpnext-two exec backend \ docker compose --project-name erpnext-two exec backend \
bench new-site three.example.com --no-mariadb-socket --mariadb-root-password changeit --install-app erpnext --admin-password changeit bench new-site --no-mariadb-socket --mariadb-root-password changeit --install-app erpnext --admin-password changeit three.example.com
# four.example.com # four.example.com
docker compose --project-name erpnext-two exec backend \ docker compose --project-name erpnext-two exec backend \
bench new-site four.example.com --no-mariadb-socket --mariadb-root-password changeit --install-app erpnext --admin-password changeit bench new-site --no-mariadb-socket --mariadb-root-password changeit --install-app erpnext --admin-password changeit four.example.com
``` ```
#### Create custom domain to existing site #### Create custom domain to existing site

View file

@ -9,7 +9,7 @@ Note:
- Wait for the `db` service to start and `configurator` to exit before trying to create a new site. Usually this takes up to 10 seconds. - Wait for the `db` service to start and `configurator` to exit before trying to create a new site. Usually this takes up to 10 seconds.
```sh ```sh
docker-compose exec backend bench new-site <site-name> --no-mariadb-socket --mariadb-root-password <db-password> --admin-password <admin-password> docker-compose exec backend bench new-site --no-mariadb-socket --mariadb-root-password <db-password> --admin-password <admin-password> <site-name>
``` ```
If you need to install some app, specify `--install-app`. To see all options, just run `bench new-site --help`. If you need to install some app, specify `--install-app`. To see all options, just run `bench new-site --help`.
@ -24,7 +24,7 @@ docker-compose exec backend bench set-config -g root_password <root-password>
Also command is slightly different: Also command is slightly different:
```sh ```sh
docker-compose exec backend bench new-site <site-name> --no-mariadb-socket --db-type postgres --admin-password <admin-password> docker-compose exec backend bench new-site --no-mariadb-socket --db-type postgres --admin-password <admin-password> <site-name>
``` ```
## Push backup to S3 storage ## Push backup to S3 storage

View file

@ -45,3 +45,11 @@ If you are using old version of `docker-compose` the .env file needs to be locat
- Set environment variable `COMPOSE_CONVERT_WINDOWS_PATHS` e.g. `set COMPOSE_CONVERT_WINDOWS_PATHS=1` - Set environment variable `COMPOSE_CONVERT_WINDOWS_PATHS` e.g. `set COMPOSE_CONVERT_WINDOWS_PATHS=1`
- While using docker machine, port-forward the ports of VM to ports of host machine. (ports 8080/8000/9000) - While using docker machine, port-forward the ports of VM to ports of host machine. (ports 8080/8000/9000)
- Name all the sites ending with `.localhost`. and access it via browser locally. e.g. `http://site1.localhost` - Name all the sites ending with `.localhost`. and access it via browser locally. e.g. `http://site1.localhost`
### Redo installation
- If you have made changes and just want to start over again (abandoning all changes), remove all docker
- containers
- images
- volumes
- Install a fresh

View file

@ -1,6 +1,6 @@
# Reference: https://github.com/frappe/frappe_docker/blob/main/docs/images-and-compose-files.md # Reference: https://github.com/frappe/frappe_docker/blob/main/docs/images-and-compose-files.md
ERPNEXT_VERSION=v14.33.2 ERPNEXT_VERSION=v15.5.0
DB_PASSWORD=123 DB_PASSWORD=123
@ -11,7 +11,6 @@ DB_PORT=
# Only if you use external Redis # Only if you use external Redis
REDIS_CACHE= REDIS_CACHE=
REDIS_QUEUE= REDIS_QUEUE=
REDIS_SOCKETIO=
# Only with HTTPS override # Only with HTTPS override
LETSENCRYPT_EMAIL=mail@example.com LETSENCRYPT_EMAIL=mail@example.com

View file

@ -95,21 +95,18 @@ USER frappe
WORKDIR /home/frappe WORKDIR /home/frappe
# Install Python via pyenv # Install Python via pyenv
ENV PYTHON_VERSION_V13=3.9.17 ENV PYTHON_VERSION_V14=3.10.13
ENV PYTHON_VERSION_DEVELOP=3.11.4 ENV PYTHON_VERSION=3.11.6
ENV PYTHON_VERSION=3.10.12
ENV PYENV_ROOT /home/frappe/.pyenv ENV PYENV_ROOT /home/frappe/.pyenv
ENV PATH $PYENV_ROOT/shims:$PYENV_ROOT/bin:$PATH ENV PATH $PYENV_ROOT/shims:$PYENV_ROOT/bin:$PATH
# From https://github.com/pyenv/pyenv#basic-github-checkout # From https://github.com/pyenv/pyenv#basic-github-checkout
RUN git clone --depth 1 https://github.com/pyenv/pyenv.git .pyenv \ RUN git clone --depth 1 https://github.com/pyenv/pyenv.git .pyenv \
&& pyenv install $PYTHON_VERSION_V13 \ && pyenv install $PYTHON_VERSION_V14 \
&& pyenv install $PYTHON_VERSION_DEVELOP \
&& pyenv install $PYTHON_VERSION \ && pyenv install $PYTHON_VERSION \
&& PYENV_VERSION=$PYTHON_VERSION_V13 pip install --no-cache-dir virtualenv \ && PYENV_VERSION=$PYTHON_VERSION_V14 pip install --no-cache-dir virtualenv \
&& PYENV_VERSION=$PYTHON_VERSION_DEVELOP pip install --no-cache-dir virtualenv \
&& PYENV_VERSION=$PYTHON_VERSION pip install --no-cache-dir virtualenv \ && PYENV_VERSION=$PYTHON_VERSION pip install --no-cache-dir virtualenv \
&& pyenv global $PYTHON_VERSION $PYTHON_VERSION_v13 \ && pyenv global $PYTHON_VERSION $PYTHON_VERSION_v14 \
&& sed -Ei -e '/^([^#]|$)/ {a export PYENV_ROOT="/home/frappe/.pyenv" a export PATH="$PYENV_ROOT/bin:$PATH" a ' -e ':a' -e '$!{n;ba};}' ~/.profile \ && sed -Ei -e '/^([^#]|$)/ {a export PYENV_ROOT="/home/frappe/.pyenv" a export PATH="$PYENV_ROOT/bin:$PATH" a ' -e ':a' -e '$!{n;ba};}' ~/.profile \
&& echo 'eval "$(pyenv init --path)"' >>~/.profile \ && echo 'eval "$(pyenv init --path)"' >>~/.profile \
&& echo 'eval "$(pyenv init -)"' >>~/.bashrc && echo 'eval "$(pyenv init -)"' >>~/.bashrc
@ -125,19 +122,15 @@ RUN git clone ${GIT_REPO} --depth 1 -b ${GIT_BRANCH} .bench \
&& echo "export BENCH_DEVELOPER=1" >>/home/frappe/.bashrc && echo "export BENCH_DEVELOPER=1" >>/home/frappe/.bashrc
# Install Node via nvm # Install Node via nvm
ENV NODE_VERSION_13=14.21.3 ENV NODE_VERSION_14=16.20.2
ENV NODE_VERSION_DEVELOP=18.12.0 ENV NODE_VERSION=18.18.2
ENV NODE_VERSION=16.20.1
ENV NVM_DIR /home/frappe/.nvm ENV NVM_DIR /home/frappe/.nvm
ENV PATH ${NVM_DIR}/versions/node/v${NODE_VERSION}/bin/:${PATH} ENV PATH ${NVM_DIR}/versions/node/v${NODE_VERSION}/bin/:${PATH}
RUN wget -qO- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.0/install.sh | bash \ RUN wget -qO- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.5/install.sh | bash \
&& . ${NVM_DIR}/nvm.sh \ && . ${NVM_DIR}/nvm.sh \
&& nvm install ${NODE_VERSION_13} \ && nvm install ${NODE_VERSION_14} \
&& nvm use v${NODE_VERSION_13} \ && nvm use v${NODE_VERSION_14} \
&& npm install -g yarn \
&& nvm install ${NODE_VERSION_DEVELOP} \
&& nvm use v${NODE_VERSION_DEVELOP} \
&& npm install -g yarn \ && npm install -g yarn \
&& nvm install ${NODE_VERSION} \ && nvm install ${NODE_VERSION} \
&& nvm use v${NODE_VERSION} \ && nvm use v${NODE_VERSION} \

View file

@ -1,4 +1,4 @@
ARG PYTHON_VERSION=3.11.4 ARG PYTHON_VERSION=3.11.6
ARG DEBIAN_BASE=bookworm ARG DEBIAN_BASE=bookworm
FROM python:${PYTHON_VERSION}-slim-${DEBIAN_BASE} AS base FROM python:${PYTHON_VERSION}-slim-${DEBIAN_BASE} AS base
@ -7,7 +7,7 @@ COPY resources/nginx-entrypoint.sh /usr/local/bin/nginx-entrypoint.sh
ARG WKHTMLTOPDF_VERSION=0.12.6.1-3 ARG WKHTMLTOPDF_VERSION=0.12.6.1-3
ARG WKHTMLTOPDF_DISTRO=bookworm ARG WKHTMLTOPDF_DISTRO=bookworm
ARG NODE_VERSION=18.16.1 ARG NODE_VERSION=18.18.2
ENV NVM_DIR=/home/frappe/.nvm ENV NVM_DIR=/home/frappe/.nvm
ENV PATH ${NVM_DIR}/versions/node/v${NODE_VERSION}/bin/:${PATH} ENV PATH ${NVM_DIR}/versions/node/v${NODE_VERSION}/bin/:${PATH}
@ -36,7 +36,7 @@ RUN useradd -ms /bin/bash frappe \
jq \ jq \
# NodeJS # NodeJS
&& mkdir -p ${NVM_DIR} \ && mkdir -p ${NVM_DIR} \
&& curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.2/install.sh | bash \ && curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.5/install.sh | bash \
&& . ${NVM_DIR}/nvm.sh \ && . ${NVM_DIR}/nvm.sh \
&& nvm install ${NODE_VERSION} \ && nvm install ${NODE_VERSION} \
&& nvm use v${NODE_VERSION} \ && nvm use v${NODE_VERSION} \
@ -103,7 +103,7 @@ RUN if [ -n "${APPS_JSON_BASE64}" ]; then \
USER frappe USER frappe
ARG FRAPPE_BRANCH=version-14 ARG FRAPPE_BRANCH=version-15
ARG FRAPPE_PATH=https://github.com/frappe/frappe ARG FRAPPE_PATH=https://github.com/frappe/frappe
RUN export APP_INSTALL_ARGS="" && \ RUN export APP_INSTALL_ARGS="" && \
if [ -n "${APPS_JSON_BASE64}" ]; then \ if [ -n "${APPS_JSON_BASE64}" ]; then \

View file

@ -1,10 +1,10 @@
ARG PYTHON_VERSION=3.11.4 ARG PYTHON_VERSION=3.11.6
ARG DEBIAN_BASE=bookworm ARG DEBIAN_BASE=bookworm
FROM python:${PYTHON_VERSION}-slim-${DEBIAN_BASE} AS base FROM python:${PYTHON_VERSION}-slim-${DEBIAN_BASE} AS base
ARG WKHTMLTOPDF_VERSION=0.12.6.1-3 ARG WKHTMLTOPDF_VERSION=0.12.6.1-3
ARG WKHTMLTOPDF_DISTRO=bookworm ARG WKHTMLTOPDF_DISTRO=bookworm
ARG NODE_VERSION=18.16.1 ARG NODE_VERSION=18.18.2
ENV NVM_DIR=/home/frappe/.nvm ENV NVM_DIR=/home/frappe/.nvm
ENV PATH ${NVM_DIR}/versions/node/v${NODE_VERSION}/bin/:${PATH} ENV PATH ${NVM_DIR}/versions/node/v${NODE_VERSION}/bin/:${PATH}
@ -33,7 +33,7 @@ RUN useradd -ms /bin/bash frappe \
jq \ jq \
# NodeJS # NodeJS
&& mkdir -p ${NVM_DIR} \ && mkdir -p ${NVM_DIR} \
&& curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.2/install.sh | bash \ && curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.5/install.sh | bash \
&& . ${NVM_DIR}/nvm.sh \ && . ${NVM_DIR}/nvm.sh \
&& nvm install ${NODE_VERSION} \ && nvm install ${NODE_VERSION} \
&& nvm use v${NODE_VERSION} \ && nvm use v${NODE_VERSION} \
@ -95,10 +95,10 @@ RUN apt-get update \
USER frappe USER frappe
ARG FRAPPE_BRANCH=version-14 ARG FRAPPE_BRANCH=version-15
ARG FRAPPE_PATH=https://github.com/frappe/frappe ARG FRAPPE_PATH=https://github.com/frappe/frappe
ARG ERPNEXT_REPO=https://github.com/frappe/erpnext ARG ERPNEXT_REPO=https://github.com/frappe/erpnext
ARG ERPNEXT_BRANCH=version-14 ARG ERPNEXT_BRANCH=version-15
RUN bench init \ RUN bench init \
--frappe-branch=${FRAPPE_BRANCH} \ --frappe-branch=${FRAPPE_BRANCH} \
--frappe-path=${FRAPPE_PATH} \ --frappe-path=${FRAPPE_PATH} \

104
install_x11_deps.sh Executable file
View file

@ -0,0 +1,104 @@
#!/bin/bash
set -e
# This script configures X11 forwarding for Linux and macOS systems.
# It installs X11, Openbox (on Linux), and checks for XQuartz (on macOS).
# It also updates the sshd_config file to enable X11Forwarding and restarts the SSH service.
# Check if the script is running with root privileges
if [ "$EUID" -ne 0 ]; then
echo "Error: This script requires root privileges. Please run it as a superuser"
exit 1
fi
# Function to restart SSH service (Linux)
restart_ssh_linux() {
if command -v service >/dev/null 2>&1; then
sudo service ssh restart
else
sudo systemctl restart ssh
fi
}
# Function to restart SSH service (macOS)
restart_ssh_macos() {
launchctl stop com.openssh.sshd
launchctl start com.openssh.sshd
}
update_x11_forwarding() {
if grep -q "X11Forwarding yes" /etc/ssh/sshd_config; then
echo "X11Forwarding is already set to 'yes' in ssh_config."
else
if [[ "$OSTYPE" == "linux-gnu" ]]; then
# Linux: Use sed for Linux
sudo sed -i 's/#\?X11Forwarding.*/X11Forwarding yes/' /etc/ssh/sshd_config
elif [[ "$OSTYPE" == "darwin"* ]]; then
# macOS: Use sed for macOS
sudo sed -i -E 's/#X11Forwarding.*/X11Forwarding yes/' /etc/ssh/sshd_config
restart_ssh_macos
fi
if [[ "$OSTYPE" == "linux-gnu" ]]; then
restart_ssh_linux
fi
fi
}
# Determine the operating system
if [[ "$OSTYPE" == "linux-gnu" ]]; then
# Linux
if command -v startx >/dev/null 2>&1; then
echo "X11 is already installed."
else
# Check which package manager is available
if command -v apt-get >/dev/null 2>&1; then
install_command="sudo apt-get update && sudo apt-get install xorg openbox"
elif command -v dnf >/dev/null 2>&1; then
install_command="sudo dnf install xorg-x11-server-Xorg openbox"
else
echo "Error: Unable to determine the package manager. Manual installation required."
exit 1
fi
fi
# Check if the installation command is defined
if [ -n "$install_command" ]; then
# Execute the installation command
if $install_command; then
echo "X11 and Openbox have been successfully installed."
else
echo "Error: Failed to install X11 and Openbox."
exit 1
fi
else
echo "Error: Unsupported package manager."
exit 1
fi
# Call the function to update X11Forwarding
update_x11_forwarding
# Get the IP address of the host dynamically
host_ip=$(hostname -I | awk '{print $1}')
xhost + "$host_ip" && xhost + local:
# Set the DISPLAY variable to the host IP
export DISPLAY="$host_ip:0.0"
echo "DISPLAY variable set to $DISPLAY"
elif [[ "$OSTYPE" == "darwin"* ]]; then
# macOS
if command -v xquartz >/dev/null 2>&1; then
echo "XQuartz is already installed."
else
echo "Error: XQuartz is required for X11 forwarding on macOS. Please install XQuartz manually."
exit 1
fi
# Call the function to update X11Forwarding
update_x11_forwarding
# Export the DISPLAY variable for macOS
export DISPLAY=:0
echo "DISPLAY variable set to $DISPLAY"
else
echo "Error: Unsupported operating system."
exit 1
fi

View file

@ -26,10 +26,6 @@ services:
networks: networks:
- bench-network - bench-network
- mariadb-network - mariadb-network
queue-default:
networks:
- bench-network
- mariadb-network
queue-short: queue-short:
networks: networks:
- bench-network - bench-network
@ -48,11 +44,6 @@ services:
- bench-network - bench-network
- mariadb-network - mariadb-network
redis-socketio:
networks:
- bench-network
- mariadb-network
networks: networks:
traefik-public: traefik-public:
external: true external: true

View file

@ -3,11 +3,9 @@ services:
environment: environment:
REDIS_CACHE: redis-cache:6379 REDIS_CACHE: redis-cache:6379
REDIS_QUEUE: redis-queue:6379 REDIS_QUEUE: redis-queue:6379
REDIS_SOCKETIO: redis-socketio:6379
depends_on: depends_on:
- redis-cache - redis-cache
- redis-queue - redis-queue
- redis-socketio
redis-cache: redis-cache:
image: redis:6.2-alpine image: redis:6.2-alpine
@ -19,12 +17,6 @@ services:
volumes: volumes:
- redis-queue-data:/data - redis-queue-data:/data
redis-socketio:
image: redis:6.2-alpine
volumes:
- redis-socketio-data:/data
volumes: volumes:
redis-cache-data: redis-cache-data:
redis-queue-data: redis-queue-data:
redis-socketio-data:

50
pwd.yml
View file

@ -2,7 +2,7 @@ version: "3"
services: services:
backend: backend:
image: frappe/erpnext:v14.33.2 image: frappe/erpnext:v15.5.0
deploy: deploy:
restart_policy: restart_policy:
condition: on-failure condition: on-failure
@ -11,13 +11,14 @@ services:
- logs:/home/frappe/frappe-bench/logs - logs:/home/frappe/frappe-bench/logs
configurator: configurator:
image: frappe/erpnext:v14.33.2 image: frappe/erpnext:v15.5.0
deploy: deploy:
restart_policy: restart_policy:
condition: none condition: none
entrypoint: entrypoint:
- bash - bash
- -c - -c
# add redis_socketio for backward compatibility
command: command:
- > - >
ls -1 apps > sites/apps.txt; ls -1 apps > sites/apps.txt;
@ -25,21 +26,20 @@ services:
bench set-config -gp db_port $$DB_PORT; bench set-config -gp db_port $$DB_PORT;
bench set-config -g redis_cache "redis://$$REDIS_CACHE"; bench set-config -g redis_cache "redis://$$REDIS_CACHE";
bench set-config -g redis_queue "redis://$$REDIS_QUEUE"; bench set-config -g redis_queue "redis://$$REDIS_QUEUE";
bench set-config -g redis_socketio "redis://$$REDIS_SOCKETIO"; bench set-config -g redis_socketio "redis://$$REDIS_QUEUE";
bench set-config -gp socketio_port $$SOCKETIO_PORT; bench set-config -gp socketio_port $$SOCKETIO_PORT;
environment: environment:
DB_HOST: db DB_HOST: db
DB_PORT: "3306" DB_PORT: "3306"
REDIS_CACHE: redis-cache:6379 REDIS_CACHE: redis-cache:6379
REDIS_QUEUE: redis-queue:6379 REDIS_QUEUE: redis-queue:6379
REDIS_SOCKETIO: redis-socketio:6379
SOCKETIO_PORT: "9000" SOCKETIO_PORT: "9000"
volumes: volumes:
- sites:/home/frappe/frappe-bench/sites - sites:/home/frappe/frappe-bench/sites
- logs:/home/frappe/frappe-bench/logs - logs:/home/frappe/frappe-bench/logs
create-site: create-site:
image: frappe/erpnext:v14.33.2 image: frappe/erpnext:v15.5.0
deploy: deploy:
restart_policy: restart_policy:
condition: none condition: none
@ -54,7 +54,6 @@ services:
wait-for-it -t 120 db:3306; wait-for-it -t 120 db:3306;
wait-for-it -t 120 redis-cache:6379; wait-for-it -t 120 redis-cache:6379;
wait-for-it -t 120 redis-queue:6379; wait-for-it -t 120 redis-queue:6379;
wait-for-it -t 120 redis-socketio:6379;
export start=`date +%s`; export start=`date +%s`;
until [[ -n `grep -hs ^ sites/common_site_config.json | jq -r ".db_host // empty"` ]] && \ 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_cache // empty"` ]] && \
@ -68,7 +67,7 @@ services:
fi fi
done; done;
echo "sites/common_site_config.json found"; echo "sites/common_site_config.json found";
bench new-site frontend --no-mariadb-socket --admin-password=admin --db-root-password=admin --install-app erpnext --set-default; bench new-site --no-mariadb-socket --admin-password=admin --db-root-password=admin --install-app erpnext --set-default frontend;
db: db:
image: mariadb:10.6 image: mariadb:10.6
@ -90,7 +89,7 @@ services:
- db-data:/var/lib/mysql - db-data:/var/lib/mysql
frontend: frontend:
image: frappe/erpnext:v14.33.2 image: frappe/erpnext:v15.5.0
deploy: deploy:
restart_policy: restart_policy:
condition: on-failure condition: on-failure
@ -111,22 +110,8 @@ services:
ports: ports:
- "8080:8080" - "8080:8080"
queue-default:
image: frappe/erpnext:v14.33.2
deploy:
restart_policy:
condition: on-failure
command:
- bench
- worker
- --queue
- default
volumes:
- sites:/home/frappe/frappe-bench/sites
- logs:/home/frappe/frappe-bench/logs
queue-long: queue-long:
image: frappe/erpnext:v14.33.2 image: frappe/erpnext:v15.5.0
deploy: deploy:
restart_policy: restart_policy:
condition: on-failure condition: on-failure
@ -134,13 +119,13 @@ services:
- bench - bench
- worker - worker
- --queue - --queue
- long - long,default,short
volumes: volumes:
- sites:/home/frappe/frappe-bench/sites - sites:/home/frappe/frappe-bench/sites
- logs:/home/frappe/frappe-bench/logs - logs:/home/frappe/frappe-bench/logs
queue-short: queue-short:
image: frappe/erpnext:v14.33.2 image: frappe/erpnext:v15.5.0
deploy: deploy:
restart_policy: restart_policy:
condition: on-failure condition: on-failure
@ -148,7 +133,7 @@ services:
- bench - bench
- worker - worker
- --queue - --queue
- short - short,default
volumes: volumes:
- sites:/home/frappe/frappe-bench/sites - sites:/home/frappe/frappe-bench/sites
- logs:/home/frappe/frappe-bench/logs - logs:/home/frappe/frappe-bench/logs
@ -169,16 +154,8 @@ services:
volumes: volumes:
- redis-cache-data:/data - redis-cache-data:/data
redis-socketio:
image: redis:6.2-alpine
deploy:
restart_policy:
condition: on-failure
volumes:
- redis-socketio-data:/data
scheduler: scheduler:
image: frappe/erpnext:v14.33.2 image: frappe/erpnext:v15.5.0
deploy: deploy:
restart_policy: restart_policy:
condition: on-failure condition: on-failure
@ -190,7 +167,7 @@ services:
- logs:/home/frappe/frappe-bench/logs - logs:/home/frappe/frappe-bench/logs
websocket: websocket:
image: frappe/erpnext:v14.33.2 image: frappe/erpnext:v15.5.0
deploy: deploy:
restart_policy: restart_policy:
condition: on-failure condition: on-failure
@ -205,6 +182,5 @@ volumes:
db-data: db-data:
redis-queue-data: redis-queue-data:
redis-cache-data: redis-cache-data:
redis-socketio-data:
sites: sites:
logs: logs:

View file

@ -1 +1 @@
pytest==7.4.0 pytest==7.4.3

View file

@ -6,12 +6,6 @@ upstream socketio-server {
server ${SOCKETIO} fail_timeout=0; server ${SOCKETIO} fail_timeout=0;
} }
# Parse the X-Forwarded-Proto header - if set - defaulting to $scheme.
map $http_x_forwarded_proto $proxy_x_forwarded_proto {
default $scheme;
https https;
}
server { server {
listen 8080; listen 8080;
server_name ${FRAPPE_SITE_NAME_HEADER}; server_name ${FRAPPE_SITE_NAME_HEADER};
@ -42,8 +36,6 @@ server {
location /socket.io { location /socket.io {
proxy_http_version 1.1; proxy_http_version 1.1;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $proxy_x_forwarded_proto;
proxy_set_header Upgrade $http_upgrade; proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade"; proxy_set_header Connection "upgrade";
proxy_set_header X-Frappe-Site-Name ${FRAPPE_SITE_NAME_HEADER}; proxy_set_header X-Frappe-Site-Name ${FRAPPE_SITE_NAME_HEADER};
@ -54,9 +46,9 @@ server {
} }
location / { location / {
rewrite ^(.+)/$ $proxy_x_forwarded_proto://${FRAPPE_SITE_NAME_HEADER}$1 permanent; rewrite ^(.+)/$ $1 permanent;
rewrite ^(.+)/index\.html$ $proxy_x_forwarded_proto://${FRAPPE_SITE_NAME_HEADER}$1 permanent; rewrite ^(.+)/index\.html$ $1 permanent;
rewrite ^(.+)\.html$ $proxy_x_forwarded_proto://${FRAPPE_SITE_NAME_HEADER}$1 permanent; rewrite ^(.+)\.html$ $1 permanent;
location ~ ^/files/.*.(htm|html|svg|xml) { location ~ ^/files/.*.(htm|html|svg|xml) {
add_header Content-disposition "attachment"; add_header Content-disposition "attachment";
@ -67,8 +59,9 @@ server {
} }
location @webserver { location @webserver {
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_http_version 1.1;
proxy_set_header X-Forwarded-Proto $proxy_x_forwarded_proto; proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Frappe-Site-Name ${FRAPPE_SITE_NAME_HEADER}; proxy_set_header X-Frappe-Site-Name ${FRAPPE_SITE_NAME_HEADER};
proxy_set_header Host $host; proxy_set_header Host $host;
proxy_set_header X-Use-X-Accel-Redirect True; proxy_set_header X-Use-X-Accel-Redirect True;

View file

@ -31,7 +31,7 @@ def get_redis_url(addr: str) -> Address:
def get_addresses(config: dict[str, Any]) -> Iterable[Address]: def get_addresses(config: dict[str, Any]) -> Iterable[Address]:
yield (config["db_host"], config["db_port"]) yield (config["db_host"], config["db_port"])
for key in ("redis_cache", "redis_queue", "redis_socketio"): for key in ("redis_cache", "redis_queue"):
yield get_redis_url(config[key]) yield get_redis_url(config[key])

View file

@ -14,9 +14,6 @@ services:
queue-short: queue-short:
image: localhost:5000/frappe/erpnext:${ERPNEXT_VERSION} image: localhost:5000/frappe/erpnext:${ERPNEXT_VERSION}
queue-default:
image: localhost:5000/frappe/erpnext:${ERPNEXT_VERSION}
queue-long: queue-long:
image: localhost:5000/frappe/erpnext:${ERPNEXT_VERSION} image: localhost:5000/frappe/erpnext:${ERPNEXT_VERSION}

View file

@ -10,7 +10,6 @@ from tests.utils import Compose, check_url_content
BACKEND_SERVICES = ( BACKEND_SERVICES = (
"backend", "backend",
"queue-short", "queue-short",
"queue-default",
"queue-long", "queue-long",
"scheduler", "scheduler",
) )
@ -127,7 +126,7 @@ class TestErpnext:
("url", "callback"), ("url", "callback"),
( (
( (
"/api/method/erpnext.templates.pages.product_search.get_product_list", "/api/method/erpnext.templates.pages.search_help.get_help_results_sections?text=help",
api_cb, api_cb,
), ),
("/assets/erpnext/js/setup_wizard.js", assets_cb), ("/assets/erpnext/js/setup_wizard.js", assets_cb),