From a1cd846d33b5ff253be19d872f7227c6fd87b749 Mon Sep 17 00:00:00 2001 From: Alexis Koralewski Date: Fri, 6 Oct 2023 17:30:02 +0200 Subject: [PATCH] add export on pyros_docker scripts and optimize dockerfile --- docker/Dockerfile | 11 ++++++----- docker/PYROS_DOCKER_BUILD.sh | 3 ++- docker/PYROS_DOCKER_INSTALL | 3 +++ docker/PYROS_DOCKER_RUN | 3 +++ docker/PYROS_DOCKER_RUN_WEBSERVER_ONLY | 3 +++ docker/PYROS_DOCKER_SHELL | 3 +++ docker/PYROS_DOCKER_TEST | 4 ++++ docker/PYROS_DOCKER_UPDATE | 3 +++ docker/PYROS_DOCKER_UPDATE_AND_RESTART | 3 +++ 9 files changed, 30 insertions(+), 6 deletions(-) diff --git a/docker/Dockerfile b/docker/Dockerfile index 7f2f9a9..32e1578 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -178,12 +178,13 @@ USER pyros_user # TODO: pourquoi numpy ??? A virer ? #RUN pip install --user numpy -# Copy local host machine files to image -COPY --chown=pyros_user:pyros_user . . -# Copy some aliases -RUN cp .bash_aliases .. -#RUN mv .bash_aliases .. +RUN mkdir -p ./vendor/guitastro/install/ +RUN mkdir -p ./install/ +# Copy local host machine files to image +COPY ./vendor/guitastro/install/requirements.in ./vendor/guitastro/install/requirements.in +COPY ./install/requirements.txt ./install/requirements.txt +COPY ./install/requirements_dev.txt ./install/requirements_dev.txt # Adding local/bin to path to avoid pip warning ENV PATH "$PATH:/home/pyros_user/.local/bin" diff --git a/docker/PYROS_DOCKER_BUILD.sh b/docker/PYROS_DOCKER_BUILD.sh index 8c60ecd..6610b1e 100755 --- a/docker/PYROS_DOCKER_BUILD.sh +++ b/docker/PYROS_DOCKER_BUILD.sh @@ -1,7 +1,8 @@ [ ! -d "../vendor/guitastro/" ] && git clone https://gitlab.irap.omp.eu/guitastrolib/guitastro.git ../vendor/guitastro/ -export CURRENT_UID=$(id -u) +export CURRENT_UID=$(id -u) +export COMPUTER_HOSTNAME=$HOSTNAME if [ $CURRENT_UID -eq 0 ] then diff --git a/docker/PYROS_DOCKER_INSTALL b/docker/PYROS_DOCKER_INSTALL index e76ce47..2d5f3e1 100755 --- a/docker/PYROS_DOCKER_INSTALL +++ b/docker/PYROS_DOCKER_INSTALL @@ -1,5 +1,8 @@ #!/usr/bin/env bash +export CURRENT_UID=$(id -u) +export COMPUTER_HOSTNAME=$HOSTNAME + # if no container is running if ! [ $(docker ps | grep 'pyros' | wc -l) -eq 4 ] ; then echo "pyros-db or pyros weren't running, starting them..." diff --git a/docker/PYROS_DOCKER_RUN b/docker/PYROS_DOCKER_RUN index 29b8328..b0a712e 100755 --- a/docker/PYROS_DOCKER_RUN +++ b/docker/PYROS_DOCKER_RUN @@ -1,5 +1,8 @@ #!/usr/bin/env bash +export CURRENT_UID=$(id -u) +export COMPUTER_HOSTNAME=$HOSTNAME + # There should be 4 pyros* containers running if ! [ $(docker ps | grep 'pyros' | wc -l) -eq 4 ] then diff --git a/docker/PYROS_DOCKER_RUN_WEBSERVER_ONLY b/docker/PYROS_DOCKER_RUN_WEBSERVER_ONLY index fb9c761..15e4b12 100755 --- a/docker/PYROS_DOCKER_RUN_WEBSERVER_ONLY +++ b/docker/PYROS_DOCKER_RUN_WEBSERVER_ONLY @@ -1,5 +1,8 @@ #!/usr/bin/env bash +export CURRENT_UID=$(id -u) +export COMPUTER_HOSTNAME=$HOSTNAME + #if no container is running if ! [ $(docker ps | grep 'pyros' | wc -l) -eq 4 ] ; then echo "pyros-db or pyros weren't running, starting them..." diff --git a/docker/PYROS_DOCKER_SHELL b/docker/PYROS_DOCKER_SHELL index 51e2258..f4d03e8 100755 --- a/docker/PYROS_DOCKER_SHELL +++ b/docker/PYROS_DOCKER_SHELL @@ -1,5 +1,8 @@ #!/usr/bin/env bash +export CURRENT_UID=$(id -u) +export COMPUTER_HOSTNAME=$HOSTNAME + #if no container is running if ! [ $(docker ps | grep 'pyros' | wc -l) -eq 4 ] then diff --git a/docker/PYROS_DOCKER_TEST b/docker/PYROS_DOCKER_TEST index ee4d774..9f972d3 100755 --- a/docker/PYROS_DOCKER_TEST +++ b/docker/PYROS_DOCKER_TEST @@ -1,5 +1,9 @@ #!/usr/bin/env bash +export CURRENT_UID=$(id -u) +export COMPUTER_HOSTNAME=$HOSTNAME + + # if no container is running if ! [ $(docker ps | grep 'pyros' | wc -l) -eq 4 ] then diff --git a/docker/PYROS_DOCKER_UPDATE b/docker/PYROS_DOCKER_UPDATE index 27daf44..9b528f3 100755 --- a/docker/PYROS_DOCKER_UPDATE +++ b/docker/PYROS_DOCKER_UPDATE @@ -1,5 +1,8 @@ #!/usr/bin/env bash +export CURRENT_UID=$(id -u) +export COMPUTER_HOSTNAME=$HOSTNAME + # If no container is running Start it if ! [ $(docker ps | grep 'pyros' | wc -l) -eq 4 ] then diff --git a/docker/PYROS_DOCKER_UPDATE_AND_RESTART b/docker/PYROS_DOCKER_UPDATE_AND_RESTART index f55e3c4..4541c28 100755 --- a/docker/PYROS_DOCKER_UPDATE_AND_RESTART +++ b/docker/PYROS_DOCKER_UPDATE_AND_RESTART @@ -1,5 +1,8 @@ #!/usr/bin/env bash +export CURRENT_UID=$(id -u) +export COMPUTER_HOSTNAME=$HOSTNAME + abort() { echo echo "********* !!! ERROR !!! ********" -- libgit2 0.21.2