From 6fcbdfe1747a2eba76f69d9b212285fe283cc6b1 Mon Sep 17 00:00:00 2001 From: pipeCh Date: Fri, 22 Dec 2017 14:09:08 +0700 Subject: [PATCH] move bench install to init.sh file --- Dockerfile | 21 +++++---------------- conf/frappe/init.sh | 3 +++ 2 files changed, 8 insertions(+), 16 deletions(-) diff --git a/Dockerfile b/Dockerfile index dd52cdf0..6ac408de 100644 --- a/Dockerfile +++ b/Dockerfile @@ -46,27 +46,16 @@ RUN wget https://bootstrap.pypa.io/get-pip.py \ && pip install --upgrade setuptools pip #install nodejs -USER root RUN curl https://deb.nodesource.com/node_6.x/pool/main/n/nodejs/nodejs_6.7.0-1nodesource1~xenial1_amd64.deb > node.deb \ && dpkg -i node.deb \ && rm node.deb #add users & sudoers -USER root -RUN useradd -ms /bin/bash frappe -RUN usermod -aG sudo frappe -RUN printf '# User rules for frappe\nfrappe ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers.d/frappe - -#clone bench repo -USER frappe -WORKDIR /home/frappe -RUN git clone -b develop https://github.com/frappe/bench.git bench-repo - -#install bench -USER root -RUN pip install -e bench-repo -RUN mkdir /home/frappe/frappe-bench -RUN chown -R frappe:frappe /home/frappe/* +RUN useradd -ms /bin/bash frappe \ + && usermod -aG sudo frappe \ + && printf '# User rules for frappe\nfrappe ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers.d/frappe \ + && mkdir /home/frappe/frappe-bench \ + && chown -R frappe:frappe /home/frappe/* COPY ./conf/frappe/* /home/frappe/ diff --git a/conf/frappe/init.sh b/conf/frappe/init.sh index 1fdee540..562fd313 100644 --- a/conf/frappe/init.sh +++ b/conf/frappe/init.sh @@ -1,5 +1,8 @@ #!/bin/bash +echo "----------------------- [ Install bench ] ---------------------------------" +git clone -b develop https://github.com/frappe/bench.git bench-repo +sudo pip install -e bench-repo echo "----------------------- [ init bench ] ---------------------------------" bench init frappe-bench --skip-bench-mkdir --skip-redis-config-generation echo "----------------------- [ config bench ] ---------------------------------"