aboutsummaryrefslogtreecommitdiffstats
path: root/standalone/src
diff options
context:
space:
mode:
Diffstat (limited to 'standalone/src')
-rw-r--r--standalone/src/main/assembly/dockerfile20
-rwxr-xr-xstandalone/src/main/assembly/run.sh5
2 files changed, 16 insertions, 9 deletions
diff --git a/standalone/src/main/assembly/dockerfile b/standalone/src/main/assembly/dockerfile
index 970eafd..4203e20 100644
--- a/standalone/src/main/assembly/dockerfile
+++ b/standalone/src/main/assembly/dockerfile
@@ -1,6 +1,12 @@
FROM tensorflow/serving:latest
-WORKDIR /home/run/
+RUN mkdir -p /home/uuihome/uui
+
+WORKDIR /home/uuihome/uui
+
+RUN groupadd uui -g 1000
+
+RUN useradd -u 1000 -d /home/uuihome/uui -g uui -s /bin/bash uui
RUN DEBIAN_FRONTEND=noninteractive apt-get update
RUN DEBIAN_FRONTEND=noninteractive apt-get install wget -y
@@ -10,12 +16,12 @@ RUN DEBIAN_FRONTEND=noninteractive apt-get install python3-pip python3-dev build
RUN ln -s /usr/bin/python3 /usr/bin/python
RUN ln -s /usr/bin/pip3 /usr/bin/pip
-COPY requirements /home/run/requirements
+COPY requirements /home/uuihome/uui/requirements
RUN DEBIAN_FRONTEND=noninteractive pip install -r requirements
+COPY scripts /home/uuihome/uui/scripts
+COPY run.sh /home/uuihome/uui/run.sh
-COPY scripts /home/run/scripts
-
-COPY run.sh /home/run/run.sh
-
-ENTRYPOINT /home/run/run.sh
+RUN chown -R uui:uui /home/uuihome/uui
+USER uui
+ENTRYPOINT /home/uuihome/uui/run.sh \ No newline at end of file
diff --git a/standalone/src/main/assembly/run.sh b/standalone/src/main/assembly/run.sh
index 6ec5f75..94b4afa 100755
--- a/standalone/src/main/assembly/run.sh
+++ b/standalone/src/main/assembly/run.sh
@@ -15,7 +15,7 @@
# limitations under the License.
#
-cd /home/run/
+cd /home/uuihome/uui/
wget https://github.com/google-research/bert/archive/master.zip
wget https://storage.googleapis.com/bert_models/2018_10_18/uncased_L-12_H-768_A-12.zip
@@ -23,8 +23,9 @@ unzip master.zip
unzip uncased_L-12_H-768_A-12.zip
rm master.zip uncased_L-12_H-768_A-12.zip
cp scripts/* bert-master/
-cd /home/run/bert-master/
+cd /home/uuihome/uui/bert-master/
+mkdir upload
nohup python -u api_squad_online.py 33011 > online.log 2>&1 &
nohup python -u api_squad_offline.py 33012 > offline.log 2>&1 &
nohup python -u upload.py 33013 > upload.log 2>&1 &