mirror of
https://github.com/frappe/frappe_docker.git
synced 2026-06-26 00:55:10 +00:00
chore: resolve merge conflict
This commit is contained in:
parent
dddb791c81
commit
7aedb4af26
18 changed files with 28 additions and 139 deletions
|
|
@ -27,14 +27,12 @@ services:
|
|||
bench set-config -gp db_port $$DB_PORT;
|
||||
bench set-config -g redis_cache "redis://$$REDIS_CACHE";
|
||||
bench set-config -g redis_queue "redis://$$REDIS_QUEUE";
|
||||
bench set-config -g redis_socketio "redis://$$REDIS_SOCKETIO";
|
||||
bench set-config -gp socketio_port $$SOCKETIO_PORT;
|
||||
environment:
|
||||
DB_HOST: ${DB_HOST}
|
||||
DB_PORT: ${DB_PORT}
|
||||
REDIS_CACHE: ${REDIS_CACHE}
|
||||
REDIS_QUEUE: ${REDIS_QUEUE}
|
||||
REDIS_SOCKETIO: ${REDIS_SOCKETIO}
|
||||
SOCKETIO_PORT: 9000
|
||||
depends_on: {}
|
||||
|
||||
|
|
@ -72,10 +70,6 @@ services:
|
|||
<<: *backend_defaults
|
||||
command: bench worker --queue short
|
||||
|
||||
queue-default:
|
||||
<<: *backend_defaults
|
||||
command: bench worker --queue default
|
||||
|
||||
queue-long:
|
||||
<<: *backend_defaults
|
||||
command: bench worker --queue long
|
||||
|
|
|
|||
|
|
@ -26,9 +26,6 @@ services:
|
|||
redis-queue:
|
||||
image: redis:alpine
|
||||
|
||||
redis-socketio:
|
||||
image: redis:alpine
|
||||
|
||||
frappe:
|
||||
image: frappe/bench:latest
|
||||
command: sleep infinity
|
||||
|
|
|
|||
|
|
@ -97,6 +97,14 @@ def get_args_parser():
|
|||
action="store_true",
|
||||
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",
|
||||
)
|
||||
return parser
|
||||
|
||||
|
||||
|
|
@ -156,17 +164,6 @@ def init_bench_if_not_exist(args):
|
|||
],
|
||||
cwd=os.getcwd() + "/" + args.bench_name,
|
||||
)
|
||||
cprint("Set redis_socketio to redis://redis-socketio:6379", level=3)
|
||||
subprocess.call(
|
||||
[
|
||||
"bench",
|
||||
"set-config",
|
||||
"-g",
|
||||
"redis_socketio",
|
||||
"redis://redis-socketio:6379",
|
||||
],
|
||||
cwd=os.getcwd() + "/" + args.bench_name,
|
||||
)
|
||||
cprint("Set developer_mode", level=3)
|
||||
subprocess.call(
|
||||
["bench", "set-config", "-gp", "developer_mode", "1"],
|
||||
|
|
@ -182,7 +179,7 @@ def create_site_in_bench(args):
|
|||
"new-site",
|
||||
"--no-mariadb-socket",
|
||||
"--mariadb-root-password=123",
|
||||
"--admin-password=admin",
|
||||
f"--admin-password={args.admin_password}",
|
||||
]
|
||||
apps = os.listdir(f"{os.getcwd()}/{args.bench_name}/apps")
|
||||
apps.remove("frappe")
|
||||
|
|
|
|||
|
|
@ -23,18 +23,6 @@
|
|||
"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",
|
||||
"type": "python",
|
||||
|
|
|
|||
|
|
@ -87,7 +87,7 @@ PYENV_VERSION=3.10.12 bench init --skip-redis-config-generation --frappe-branch
|
|||
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
|
||||
nvm use v14
|
||||
|
|
@ -103,7 +103,6 @@ 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 redis_cache redis://redis-cache:6379
|
||||
bench set-config -g redis_queue redis://redis-queue:6379
|
||||
bench set-config -g redis_socketio redis://redis-socketio:6379
|
||||
```
|
||||
|
||||
For any reason the above commands fail, set the values in `common_site_config.json` manually.
|
||||
|
|
@ -112,8 +111,7 @@ For any reason the above commands fail, set the values in `common_site_config.js
|
|||
{
|
||||
"db_host": "mariadb",
|
||||
"redis_cache": "redis://redis-cache:6379",
|
||||
"redis_queue": "redis://redis-queue:6379",
|
||||
"redis_socketio": "redis://redis-socketio:6379"
|
||||
"redis_queue": "redis://redis-queue:6379"
|
||||
}
|
||||
```
|
||||
|
||||
|
|
@ -236,7 +234,7 @@ 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.
|
||||
|
||||
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.
|
||||
|
||||
|
|
@ -269,6 +267,8 @@ options:
|
|||
-n NODE_VERSION, --node-version NODE_VERSION
|
||||
node version, default: Not Set
|
||||
-v, --verbose verbose output
|
||||
-a ADMIN_PASSWORD, --admin-password ADMIN_PASSWORD
|
||||
admin password for site, default: admin
|
||||
```
|
||||
|
||||
A new bench and / or site is created for the client with following defaults.
|
||||
|
|
|
|||
|
|
@ -39,11 +39,7 @@ Hostname for redis server to store cache. Set only if external service for redis
|
|||
|
||||
### `REDIS_QUEUE`
|
||||
|
||||
Hostname for redis server to store queue data. Set only if external service for redis is used.
|
||||
|
||||
### `REDIS_SOCKETIO`
|
||||
|
||||
Hostname for redis server to store socketio data. Set only if external service for redis is used.
|
||||
Hostname for redis server to store queue data and socketio. Set only if external service for redis is used.
|
||||
|
||||
### `ERPNEXT_VERSION`
|
||||
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
- `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).
|
||||
- `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/).
|
||||
|
||||
## Overrides
|
||||
|
|
|
|||
|
|
@ -62,14 +62,12 @@ configurator:
|
|||
bench set-config -gp db_port $$DB_PORT;
|
||||
bench set-config -g redis_cache "redis://$$REDIS_CACHE";
|
||||
bench set-config -g redis_queue "redis://$$REDIS_QUEUE";
|
||||
bench set-config -g redis_socketio "redis://$$REDIS_SOCKETIO";
|
||||
bench set-config -gp socketio_port $$SOCKETIO_PORT;
|
||||
environment:
|
||||
DB_HOST: db
|
||||
DB_PORT: "3306"
|
||||
REDIS_CACHE: redis-cache:6379
|
||||
REDIS_QUEUE: redis-queue:6379
|
||||
REDIS_SOCKETIO: redis-socketio:6379
|
||||
SOCKETIO_PORT: "9000"
|
||||
# ... removed for brevity
|
||||
```
|
||||
|
|
@ -95,7 +93,6 @@ create-site:
|
|||
wait-for-it -t 120 db:3306;
|
||||
wait-for-it -t 120 redis-cache:6379;
|
||||
wait-for-it -t 120 redis-queue:6379;
|
||||
wait-for-it -t 120 redis-socketio:6379;
|
||||
export start=`date +%s`;
|
||||
until [[ -n `grep -hs ^ sites/common_site_config.json | jq -r ".db_host // empty"` ]] && \
|
||||
[[ -n `grep -hs ^ sites/common_site_config.json | jq -r ".redis_cache // empty"` ]] && \
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
||||
In this case make sure you've set `DB_HOST`, `DB_PORT`, `REDIS_CACHE`, `REDIS_QUEUE` and `REDIS_SOCKETIO`
|
||||
environment variables or the `configurator` will fail.
|
||||
In this case make sure you've set `DB_HOST`, `DB_PORT`, `REDIS_CACHE` and `REDIS_QUEUE` environment variables or the `configurator` will fail.
|
||||
|
||||
```sh
|
||||
# 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
|
||||
|
||||
In this case make sure you've set `DB_HOST`, `DB_PORT`, `REDIS_CACHE`, `REDIS_QUEUE` and `REDIS_SOCKETIO`
|
||||
environment variables or the `configurator` will fail.
|
||||
In this case make sure you've set `DB_HOST`, `DB_PORT`, `REDIS_CACHE` and `REDIS_QUEUE` environment variables or the `configurator` will fail.
|
||||
|
||||
```sh
|
||||
# Generate YAML
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ version: "3"
|
|||
|
||||
services:
|
||||
backend:
|
||||
image: frappe/erpnext:v14.27.1
|
||||
image: frappe/erpnext:v14
|
||||
platform: linux/amd64
|
||||
deploy:
|
||||
restart_policy:
|
||||
|
|
@ -25,7 +25,7 @@ services:
|
|||
- logs:/home/frappe/frappe-bench/logs
|
||||
|
||||
configurator:
|
||||
image: frappe/erpnext:v14.27.1
|
||||
image: frappe/erpnext:v14
|
||||
platform: linux/amd64
|
||||
deploy:
|
||||
restart_policy:
|
||||
|
|
@ -40,21 +40,19 @@ services:
|
|||
bench set-config -gp db_port $$DB_PORT;
|
||||
bench set-config -g redis_cache "redis://$$REDIS_CACHE";
|
||||
bench set-config -g redis_queue "redis://$$REDIS_QUEUE";
|
||||
bench set-config -g redis_socketio "redis://$$REDIS_SOCKETIO";
|
||||
bench set-config -gp socketio_port $$SOCKETIO_PORT;
|
||||
environment:
|
||||
DB_HOST: db
|
||||
DB_PORT: "3306"
|
||||
REDIS_CACHE: redis-cache:6379
|
||||
REDIS_QUEUE: redis-queue:6379
|
||||
REDIS_SOCKETIO: redis-socketio:6379
|
||||
SOCKETIO_PORT: "9000"
|
||||
volumes:
|
||||
- sites:/home/frappe/frappe-bench/sites
|
||||
- logs:/home/frappe/frappe-bench/logs
|
||||
|
||||
create-site:
|
||||
image: frappe/erpnext:v14.27.1
|
||||
image: frappe/erpnext:v14
|
||||
platform: linux/amd64
|
||||
deploy:
|
||||
restart_policy:
|
||||
|
|
@ -70,7 +68,6 @@ services:
|
|||
wait-for-it -t 120 db:3306;
|
||||
wait-for-it -t 120 redis-cache:6379;
|
||||
wait-for-it -t 120 redis-queue:6379;
|
||||
wait-for-it -t 120 redis-socketio:6379;
|
||||
export start=`date +%s`;
|
||||
until [[ -n `grep -hs ^ sites/common_site_config.json | jq -r ".db_host // empty"` ]] && \
|
||||
[[ -n `grep -hs ^ sites/common_site_config.json | jq -r ".redis_cache // empty"` ]] && \
|
||||
|
|
@ -107,7 +104,7 @@ services:
|
|||
- db-data:/var/lib/mysql
|
||||
|
||||
frontend:
|
||||
image: frappe/erpnext:v14.27.1
|
||||
image: frappe/erpnext:v14
|
||||
platform: linux/amd64
|
||||
deploy:
|
||||
restart_policy:
|
||||
|
|
@ -129,23 +126,8 @@ services:
|
|||
ports:
|
||||
- "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:
|
||||
image: frappe/erpnext:v14.27.1
|
||||
image: frappe/erpnext:v14
|
||||
platform: linux/amd64
|
||||
deploy:
|
||||
restart_policy:
|
||||
|
|
@ -160,7 +142,7 @@ services:
|
|||
- logs:/home/frappe/frappe-bench/logs
|
||||
|
||||
queue-short:
|
||||
image: frappe/erpnext:v14.27.1
|
||||
image: frappe/erpnext:v14
|
||||
platform: linux/amd64
|
||||
deploy:
|
||||
restart_policy:
|
||||
|
|
@ -192,17 +174,8 @@ services:
|
|||
volumes:
|
||||
- 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:
|
||||
image: frappe/erpnext:v14.27.1
|
||||
image: frappe/erpnext:v14
|
||||
platform: linux/amd64
|
||||
deploy:
|
||||
restart_policy:
|
||||
|
|
@ -215,7 +188,7 @@ services:
|
|||
- logs:/home/frappe/frappe-bench/logs
|
||||
|
||||
websocket:
|
||||
image: frappe/erpnext:v14.27.1
|
||||
image: frappe/erpnext:v14
|
||||
platform: linux/amd64
|
||||
deploy:
|
||||
restart_policy:
|
||||
|
|
@ -231,7 +204,6 @@ volumes:
|
|||
db-data:
|
||||
redis-queue-data:
|
||||
redis-cache-data:
|
||||
redis-socketio-data:
|
||||
sites:
|
||||
logs:
|
||||
```
|
||||
|
|
|
|||
|
|
@ -8,7 +8,6 @@ This setup is a very simple single compose file that does everything to start re
|
|||
|
||||
- backend, serves gunicorn backend
|
||||
- frontend, serves static assets through nginx frontend reverse proxies websocket and gunicorn.
|
||||
- queue-default, default rq worker.
|
||||
- queue-long, long rq worker.
|
||||
- queue-short, short rq worker.
|
||||
- schedule, event scheduler.
|
||||
|
|
@ -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.
|
||||
- redis-cache, redis for cache data.
|
||||
- redis-queue, redis for rq data.
|
||||
- redis-socketio, redis for socketio pubsub.
|
||||
- redis-queue, redis for rq data and pub/sub.
|
||||
|
||||
## Volumes
|
||||
|
||||
|
|
|
|||
|
|
@ -11,7 +11,6 @@ DB_PORT=
|
|||
# Only if you use external Redis
|
||||
REDIS_CACHE=
|
||||
REDIS_QUEUE=
|
||||
REDIS_SOCKETIO=
|
||||
|
||||
# Only with HTTPS override
|
||||
LETSENCRYPT_EMAIL=mail@example.com
|
||||
|
|
|
|||
|
|
@ -26,10 +26,6 @@ services:
|
|||
networks:
|
||||
- bench-network
|
||||
- mariadb-network
|
||||
queue-default:
|
||||
networks:
|
||||
- bench-network
|
||||
- mariadb-network
|
||||
queue-short:
|
||||
networks:
|
||||
- bench-network
|
||||
|
|
@ -48,11 +44,6 @@ services:
|
|||
- bench-network
|
||||
- mariadb-network
|
||||
|
||||
redis-socketio:
|
||||
networks:
|
||||
- bench-network
|
||||
- mariadb-network
|
||||
|
||||
networks:
|
||||
traefik-public:
|
||||
external: true
|
||||
|
|
|
|||
|
|
@ -3,11 +3,9 @@ services:
|
|||
environment:
|
||||
REDIS_CACHE: redis-cache:6379
|
||||
REDIS_QUEUE: redis-queue:6379
|
||||
REDIS_SOCKETIO: redis-socketio:6379
|
||||
depends_on:
|
||||
- redis-cache
|
||||
- redis-queue
|
||||
- redis-socketio
|
||||
|
||||
redis-cache:
|
||||
image: redis:6.2-alpine
|
||||
|
|
@ -19,12 +17,6 @@ services:
|
|||
volumes:
|
||||
- redis-queue-data:/data
|
||||
|
||||
redis-socketio:
|
||||
image: redis:6.2-alpine
|
||||
volumes:
|
||||
- redis-socketio-data:/data
|
||||
|
||||
volumes:
|
||||
redis-cache-data:
|
||||
redis-queue-data:
|
||||
redis-socketio-data:
|
||||
|
|
|
|||
26
pwd.yml
26
pwd.yml
|
|
@ -25,14 +25,12 @@ services:
|
|||
bench set-config -gp db_port $$DB_PORT;
|
||||
bench set-config -g redis_cache "redis://$$REDIS_CACHE";
|
||||
bench set-config -g redis_queue "redis://$$REDIS_QUEUE";
|
||||
bench set-config -g redis_socketio "redis://$$REDIS_SOCKETIO";
|
||||
bench set-config -gp socketio_port $$SOCKETIO_PORT;
|
||||
environment:
|
||||
DB_HOST: db
|
||||
DB_PORT: "3306"
|
||||
REDIS_CACHE: redis-cache:6379
|
||||
REDIS_QUEUE: redis-queue:6379
|
||||
REDIS_SOCKETIO: redis-socketio:6379
|
||||
SOCKETIO_PORT: "9000"
|
||||
volumes:
|
||||
- sites:/home/frappe/frappe-bench/sites
|
||||
|
|
@ -54,7 +52,6 @@ services:
|
|||
wait-for-it -t 120 db:3306;
|
||||
wait-for-it -t 120 redis-cache:6379;
|
||||
wait-for-it -t 120 redis-queue:6379;
|
||||
wait-for-it -t 120 redis-socketio:6379;
|
||||
export start=`date +%s`;
|
||||
until [[ -n `grep -hs ^ sites/common_site_config.json | jq -r ".db_host // empty"` ]] && \
|
||||
[[ -n `grep -hs ^ sites/common_site_config.json | jq -r ".redis_cache // empty"` ]] && \
|
||||
|
|
@ -111,20 +108,6 @@ services:
|
|||
ports:
|
||||
- "8080:8080"
|
||||
|
||||
queue-default:
|
||||
image: frappe/erpnext:v14.44.1
|
||||
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:
|
||||
image: frappe/erpnext:v14.44.1
|
||||
deploy:
|
||||
|
|
@ -169,14 +152,6 @@ services:
|
|||
volumes:
|
||||
- redis-cache-data:/data
|
||||
|
||||
redis-socketio:
|
||||
image: redis:6.2-alpine
|
||||
deploy:
|
||||
restart_policy:
|
||||
condition: on-failure
|
||||
volumes:
|
||||
- redis-socketio-data:/data
|
||||
|
||||
scheduler:
|
||||
image: frappe/erpnext:v14.44.1
|
||||
deploy:
|
||||
|
|
@ -205,6 +180,5 @@ volumes:
|
|||
db-data:
|
||||
redis-queue-data:
|
||||
redis-cache-data:
|
||||
redis-socketio-data:
|
||||
sites:
|
||||
logs:
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ def get_redis_url(addr: str) -> Address:
|
|||
|
||||
def get_addresses(config: dict[str, Any]) -> Iterable[Address]:
|
||||
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])
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -14,9 +14,6 @@ services:
|
|||
queue-short:
|
||||
image: localhost:5000/frappe/erpnext:${ERPNEXT_VERSION}
|
||||
|
||||
queue-default:
|
||||
image: localhost:5000/frappe/erpnext:${ERPNEXT_VERSION}
|
||||
|
||||
queue-long:
|
||||
image: localhost:5000/frappe/erpnext:${ERPNEXT_VERSION}
|
||||
|
||||
|
|
|
|||
|
|
@ -10,7 +10,6 @@ from tests.utils import Compose, check_url_content
|
|||
BACKEND_SERVICES = (
|
||||
"backend",
|
||||
"queue-short",
|
||||
"queue-default",
|
||||
"queue-long",
|
||||
"scheduler",
|
||||
)
|
||||
|
|
|
|||
Loading…
Reference in a new issue