diff --git a/configs/docker/build/Dockerfile b/configs/docker/build/Dockerfile index 696ba0b427fbadbf6799b609313a38efa7f66276..d1507f24aca422a51bd4c61edfec7a985346c292 100644 --- a/configs/docker/build/Dockerfile +++ b/configs/docker/build/Dockerfile @@ -1,12 +1,14 @@ # syntax=docker/dockerfile:1 FROM ubuntu:18.04 as base_image -#create dirs -WORKDIR /home -RUN mkdir /home/code +#run mkdir as root RUN mkdir -p /storage/app/EWS_prod/regions/EastAfrica/workspace RUN mkdir -p /storage/app/EWS_prod/regions/SouthAsia/workspace +#create dirs +WORKDIR /home +#RUN mkdir /home/ewsmanager/code + #copy resources in COPY ./conda-env-py3EWS-withbuilds.yml . @@ -28,3 +30,13 @@ RUN conda env create --file conda-env-py3EWS-withbuilds.yml --prefix /storage/ap #tidy RUN rm -v ~/miniconda.sh conda-env-py3EWS-withbuilds.yml; + +#these usernames and ids match the production server (IaaS), override when building a local image if needed +ARG GNAME=ews +ARG UNAME=ewsmanager +ARG UID=1006 +ARG GID=1008 +RUN groupadd -g $GID $GNAME +RUN useradd -m -u $UID -g $GID -o -s /bin/bash $UNAME +USER ewsmanager +WORKDIR /home/ewsmanager diff --git a/configs/docker/run/runDockerEWS.sh b/configs/docker/run/runDockerEWS.sh index aa8a64d0fb141e6c88cd2f27d519f591fa0b3a0b..3fd000dd5583571d20eb68d01dd9031b6eba0598 100755 --- a/configs/docker/run/runDockerEWS.sh +++ b/configs/docker/run/runDockerEWS.sh @@ -26,7 +26,7 @@ do shift 2 ;; -h | --help) - "This is a launch script, example usage:\nrunDockerEWS.sh -p Deposition -c -c /<path>/config_EastAfrica_fc_live.json -s 20220808" + "This is a launch script, example usage: runDockerEWS.sh -p Deposition -c -c /<path>/config_EastAfrica_fc_live.json -s 20220808" exit 2 ;; --)