Commit a1cd846d33b5ff253be19d872f7227c6fd87b749

Authored by Alexis Koralewski
1 parent 64fe9f0c
Exists in dev

add export on pyros_docker scripts and optimize dockerfile

docker/Dockerfile
@@ -178,12 +178,13 @@ USER pyros_user @@ -178,12 +178,13 @@ USER pyros_user
178 # TODO: pourquoi numpy ??? A virer ? 178 # TODO: pourquoi numpy ??? A virer ?
179 #RUN pip install --user numpy 179 #RUN pip install --user numpy
180 180
181 -# Copy local host machine files to image  
182 -COPY --chown=pyros_user:pyros_user . .  
183 -# Copy some aliases  
184 -RUN cp .bash_aliases ..  
185 -#RUN mv .bash_aliases .. 181 +RUN mkdir -p ./vendor/guitastro/install/
  182 +RUN mkdir -p ./install/
186 183
  184 +# Copy local host machine files to image
  185 +COPY ./vendor/guitastro/install/requirements.in ./vendor/guitastro/install/requirements.in
  186 +COPY ./install/requirements.txt ./install/requirements.txt
  187 +COPY ./install/requirements_dev.txt ./install/requirements_dev.txt
187 188
188 # Adding local/bin to path to avoid pip warning 189 # Adding local/bin to path to avoid pip warning
189 ENV PATH "$PATH:/home/pyros_user/.local/bin" 190 ENV PATH "$PATH:/home/pyros_user/.local/bin"
docker/PYROS_DOCKER_BUILD.sh
1 1
2 [ ! -d "../vendor/guitastro/" ] && git clone https://gitlab.irap.omp.eu/guitastrolib/guitastro.git ../vendor/guitastro/ 2 [ ! -d "../vendor/guitastro/" ] && git clone https://gitlab.irap.omp.eu/guitastrolib/guitastro.git ../vendor/guitastro/
3 3
4 -export CURRENT_UID=$(id -u) 4 +export CURRENT_UID=$(id -u)
  5 +export COMPUTER_HOSTNAME=$HOSTNAME
5 6
6 if [ $CURRENT_UID -eq 0 ] 7 if [ $CURRENT_UID -eq 0 ]
7 then 8 then
docker/PYROS_DOCKER_INSTALL
1 #!/usr/bin/env bash 1 #!/usr/bin/env bash
2 2
  3 +export CURRENT_UID=$(id -u)
  4 +export COMPUTER_HOSTNAME=$HOSTNAME
  5 +
3 # if no container is running 6 # if no container is running
4 if ! [ $(docker ps | grep 'pyros' | wc -l) -eq 4 ] ; then 7 if ! [ $(docker ps | grep 'pyros' | wc -l) -eq 4 ] ; then
5 echo "pyros-db or pyros weren't running, starting them..." 8 echo "pyros-db or pyros weren't running, starting them..."
docker/PYROS_DOCKER_RUN
1 #!/usr/bin/env bash 1 #!/usr/bin/env bash
2 2
  3 +export CURRENT_UID=$(id -u)
  4 +export COMPUTER_HOSTNAME=$HOSTNAME
  5 +
3 # There should be 4 pyros* containers running 6 # There should be 4 pyros* containers running
4 if ! [ $(docker ps | grep 'pyros' | wc -l) -eq 4 ] 7 if ! [ $(docker ps | grep 'pyros' | wc -l) -eq 4 ]
5 then 8 then
docker/PYROS_DOCKER_RUN_WEBSERVER_ONLY
1 #!/usr/bin/env bash 1 #!/usr/bin/env bash
2 2
  3 +export CURRENT_UID=$(id -u)
  4 +export COMPUTER_HOSTNAME=$HOSTNAME
  5 +
3 #if no container is running 6 #if no container is running
4 if ! [ $(docker ps | grep 'pyros' | wc -l) -eq 4 ] ; then 7 if ! [ $(docker ps | grep 'pyros' | wc -l) -eq 4 ] ; then
5 echo "pyros-db or pyros weren't running, starting them..." 8 echo "pyros-db or pyros weren't running, starting them..."
docker/PYROS_DOCKER_SHELL
1 #!/usr/bin/env bash 1 #!/usr/bin/env bash
2 2
  3 +export CURRENT_UID=$(id -u)
  4 +export COMPUTER_HOSTNAME=$HOSTNAME
  5 +
3 #if no container is running 6 #if no container is running
4 if ! [ $(docker ps | grep 'pyros' | wc -l) -eq 4 ] 7 if ! [ $(docker ps | grep 'pyros' | wc -l) -eq 4 ]
5 then 8 then
docker/PYROS_DOCKER_TEST
1 #!/usr/bin/env bash 1 #!/usr/bin/env bash
2 2
  3 +export CURRENT_UID=$(id -u)
  4 +export COMPUTER_HOSTNAME=$HOSTNAME
  5 +
  6 +
3 # if no container is running 7 # if no container is running
4 if ! [ $(docker ps | grep 'pyros' | wc -l) -eq 4 ] 8 if ! [ $(docker ps | grep 'pyros' | wc -l) -eq 4 ]
5 then 9 then
docker/PYROS_DOCKER_UPDATE
1 #!/usr/bin/env bash 1 #!/usr/bin/env bash
2 2
  3 +export CURRENT_UID=$(id -u)
  4 +export COMPUTER_HOSTNAME=$HOSTNAME
  5 +
3 # If no container is running Start it 6 # If no container is running Start it
4 if ! [ $(docker ps | grep 'pyros' | wc -l) -eq 4 ] 7 if ! [ $(docker ps | grep 'pyros' | wc -l) -eq 4 ]
5 then 8 then
docker/PYROS_DOCKER_UPDATE_AND_RESTART
1 #!/usr/bin/env bash 1 #!/usr/bin/env bash
2 2
  3 +export CURRENT_UID=$(id -u)
  4 +export COMPUTER_HOSTNAME=$HOSTNAME
  5 +
3 abort() { 6 abort() {
4 echo 7 echo
5 echo "********* !!! ERROR !!! ********" 8 echo "********* !!! ERROR !!! ********"