mirror of
https://github.com/frappe/frappe_docker.git
synced 2024-11-09 23:00:56 +00:00
fix: accept args for bench commands
This commit is contained in:
parent
358e1ca7c9
commit
e9080d3952
19
build/common/worker/bench
Executable file
19
build/common/worker/bench
Executable file
@ -0,0 +1,19 @@
|
||||
#!/home/frappe/frappe-bench/env/bin/python
|
||||
|
||||
import subprocess
|
||||
import sys
|
||||
import os
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
bench_dir = os.path.join(os.sep, 'home', 'frappe', 'frappe-bench')
|
||||
sites_dir = os.path.join(bench_dir, 'sites')
|
||||
bench_helper = os.path.join(
|
||||
bench_dir, 'apps', 'frappe',
|
||||
'frappe', 'utils', 'bench_helper.py',
|
||||
)
|
||||
cwd = os.getcwd()
|
||||
os.chdir(sites_dir)
|
||||
subprocess.check_call(
|
||||
[sys.executable, bench_helper, 'frappe'] + sys.argv[1:],
|
||||
)
|
@ -201,15 +201,8 @@ elif [ "$1" = 'restore-backup' ]; then
|
||||
&& python /home/frappe/frappe-bench/commands/restore_backup.py"
|
||||
exit
|
||||
|
||||
elif [ "$1" = 'bench' ]; then
|
||||
|
||||
exec su frappe -c '/home/frappe/frappe-bench/env/bin/python \
|
||||
/home/frappe/frappe-bench/apps/frappe/frappe/utils/bench_helper.py \
|
||||
frappe "$@"'
|
||||
exit
|
||||
|
||||
else
|
||||
|
||||
exec su frappe -c "$@"
|
||||
exec $@
|
||||
|
||||
fi
|
||||
|
@ -57,6 +57,7 @@ USER root
|
||||
COPY build/common/commands/* /home/frappe/frappe-bench/commands/
|
||||
COPY build/common/common_site_config.json.template /opt/frappe/common_site_config.json.template
|
||||
COPY build/common/worker/install_app.sh /usr/local/bin/install_app
|
||||
COPY build/common/worker/bench /usr/local/bin/bench
|
||||
|
||||
# Setup docker-entrypoint
|
||||
COPY build/common/worker/docker-entrypoint.sh /usr/local/bin/docker-entrypoint.sh
|
||||
|
@ -413,4 +413,5 @@ echo -e "\e[1m\e[4mCheck bench --help\e[0m"
|
||||
docker run \
|
||||
-v frappebench00_sites-vol:/home/frappe/frappe-bench/sites \
|
||||
--network frappebench00_default \
|
||||
--user frappe \
|
||||
frappe/erpnext-worker:edge bench --help
|
||||
|
@ -23,7 +23,6 @@ services:
|
||||
|
||||
erpnext-nginx:
|
||||
image: frappe/erpnext-nginx:edge
|
||||
restart: on-failure
|
||||
environment:
|
||||
- FRAPPE_PY=erpnext-python
|
||||
- FRAPPE_PY_PORT=8000
|
||||
|
Loading…
Reference in New Issue
Block a user