diff --git a/Dockerfile b/Dockerfile index f37a1eb0..3eca918a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -29,6 +29,7 @@ USER root RUN pip install -e bench-repo && rm -rf ~/.cache/pip \ && npm install -g yarn \ && chown -R frappe:frappe /home/frappe/* +RUN printf '# User rules for frappe\nfrappe ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers.d/frappe USER frappe WORKDIR /home/frappe/frappe-bench diff --git a/dbench b/dbench index 0eb66e5c..aaaae858 100755 --- a/dbench +++ b/dbench @@ -17,9 +17,7 @@ elif [ "$1" == 'setup' ] && [ "$2" == 'hosts' ]; then a="${a//$'\n'/ }" a=$(echo $a | tr -d / ) result="127.0.0.1 ${a}" - echo $result | sudo tee -a /etc/hosts docker exec -iu root frappe bash -c "echo ${result} | tee --append /etc/hosts" - docker exec -itu root frappe bash -c "printf '# User rules for frappe\nfrappe ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers.d/frappe" elif [ "$1" == '-c' ]; then shift user=$1