mirror of
https://github.com/frappe/frappe_docker.git
synced 2026-06-17 13:55:08 +00:00
Add dev environment setup
This commit is contained in:
parent
7ef1d3e664
commit
f5d6005eb5
5 changed files with 65 additions and 0 deletions
2
bin/bench.sh
Executable file
2
bin/bench.sh
Executable file
|
|
@ -0,0 +1,2 @@
|
|||
#!/bin/bash
|
||||
docker compose -p ranch exec backend bench ${@:1}
|
||||
9
bin/dev-destroy.sh
Executable file
9
bin/dev-destroy.sh
Executable file
|
|
@ -0,0 +1,9 @@
|
|||
#!/bin/bash
|
||||
docker compose \
|
||||
-p ranch \
|
||||
-f compose.yaml \
|
||||
-f overrides/compose.redis.yaml \
|
||||
-f overrides/compose.postgres.yaml \
|
||||
-f overrides/compose.proxy.yaml \
|
||||
-f compose.my-local-dev.yaml \
|
||||
down --volumes --remove-orphans
|
||||
24
bin/dev-setup.sh
Executable file
24
bin/dev-setup.sh
Executable file
|
|
@ -0,0 +1,24 @@
|
|||
#!/bin/bash
|
||||
bin/bench.sh new-site ranch.localhost \
|
||||
--db-root-username=root \
|
||||
--db-host=db \
|
||||
--db-type=mariadb \
|
||||
--mariadb-user-host-login-scope=% \
|
||||
--db-root-password=123 \
|
||||
--admin-password=123
|
||||
|
||||
bin/bench.sh --site ranch.localhost set-config developer_mode true
|
||||
|
||||
bin/bench.sh --site ranch.localhost install-app erpnext
|
||||
|
||||
for app in $(find apps -mindepth 1 -maxdepth 1 -type d | xargs -n1 basename); do
|
||||
docker compose -p ranch exec backend bash -lc "cd /home/frappe/frappe-bench && ./env/bin/pip install -e apps/${app}"
|
||||
docker compose -p ranch exec backend bash -lc "cd /home/frappe/frappe-bench; grep -qxF ${app} sites/apps.txt || printf '%s\\n' '${app}' >> sites/apps.txt"
|
||||
bin/bench.sh --site ranch.localhost install-app "${app}"
|
||||
done
|
||||
|
||||
bin/bench.sh --site ranch.localhost migrate
|
||||
bin/bench.sh --site ranch.localhost clear-cache
|
||||
docker compose -p ranch restart backend queue-short queue-long scheduler
|
||||
|
||||
echo "Done! Access your local dev environment at http://ranch.localhost"
|
||||
10
bin/dev-up.sh
Executable file
10
bin/dev-up.sh
Executable file
|
|
@ -0,0 +1,10 @@
|
|||
#!/bin/bash
|
||||
docker compose \
|
||||
--env-file .env \
|
||||
-f compose.yaml \
|
||||
-p ranch \
|
||||
-f overrides/compose.redis.yaml \
|
||||
-f overrides/compose.mariadb.yaml \
|
||||
-f overrides/compose.proxy.yaml \
|
||||
-f compose.my-local-dev.yaml \
|
||||
up
|
||||
20
compose.my-local-dev.yaml
Normal file
20
compose.my-local-dev.yaml
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
x-local-app: &local_app
|
||||
environment:
|
||||
PYTHONPATH: /home/frappe/frappe-bench/apps/testing
|
||||
ERPNEXT_VERSION: v16.22.0
|
||||
volumes:
|
||||
- sites:/home/frappe/frappe-bench/sites
|
||||
- ./apps/testing:/home/frappe/frappe-bench/apps/testing
|
||||
|
||||
services:
|
||||
backend:
|
||||
<<: *local_app
|
||||
|
||||
queue-short:
|
||||
<<: *local_app
|
||||
|
||||
queue-long:
|
||||
<<: *local_app
|
||||
|
||||
scheduler:
|
||||
<<: *local_app
|
||||
Loading…
Reference in a new issue