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 178 # TODO: pourquoi numpy ??? A virer ?
179 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 189 # Adding local/bin to path to avoid pip warning
189 190 ENV PATH "$PATH:/home/pyros_user/.local/bin"
... ...
docker/PYROS_DOCKER_BUILD.sh
1 1  
2 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 7 if [ $CURRENT_UID -eq 0 ]
7 8 then
... ...
docker/PYROS_DOCKER_INSTALL
1 1 #!/usr/bin/env bash
2 2  
  3 +export CURRENT_UID=$(id -u)
  4 +export COMPUTER_HOSTNAME=$HOSTNAME
  5 +
3 6 # if no container is running
4 7 if ! [ $(docker ps | grep 'pyros' | wc -l) -eq 4 ] ; then
5 8 echo "pyros-db or pyros weren't running, starting them..."
... ...
docker/PYROS_DOCKER_RUN
1 1 #!/usr/bin/env bash
2 2  
  3 +export CURRENT_UID=$(id -u)
  4 +export COMPUTER_HOSTNAME=$HOSTNAME
  5 +
3 6 # There should be 4 pyros* containers running
4 7 if ! [ $(docker ps | grep 'pyros' | wc -l) -eq 4 ]
5 8 then
... ...
docker/PYROS_DOCKER_RUN_WEBSERVER_ONLY
1 1 #!/usr/bin/env bash
2 2  
  3 +export CURRENT_UID=$(id -u)
  4 +export COMPUTER_HOSTNAME=$HOSTNAME
  5 +
3 6 #if no container is running
4 7 if ! [ $(docker ps | grep 'pyros' | wc -l) -eq 4 ] ; then
5 8 echo "pyros-db or pyros weren't running, starting them..."
... ...
docker/PYROS_DOCKER_SHELL
1 1 #!/usr/bin/env bash
2 2  
  3 +export CURRENT_UID=$(id -u)
  4 +export COMPUTER_HOSTNAME=$HOSTNAME
  5 +
3 6 #if no container is running
4 7 if ! [ $(docker ps | grep 'pyros' | wc -l) -eq 4 ]
5 8 then
... ...
docker/PYROS_DOCKER_TEST
1 1 #!/usr/bin/env bash
2 2  
  3 +export CURRENT_UID=$(id -u)
  4 +export COMPUTER_HOSTNAME=$HOSTNAME
  5 +
  6 +
3 7 # if no container is running
4 8 if ! [ $(docker ps | grep 'pyros' | wc -l) -eq 4 ]
5 9 then
... ...
docker/PYROS_DOCKER_UPDATE
1 1 #!/usr/bin/env bash
2 2  
  3 +export CURRENT_UID=$(id -u)
  4 +export COMPUTER_HOSTNAME=$HOSTNAME
  5 +
3 6 # If no container is running Start it
4 7 if ! [ $(docker ps | grep 'pyros' | wc -l) -eq 4 ]
5 8 then
... ...
docker/PYROS_DOCKER_UPDATE_AND_RESTART
1 1 #!/usr/bin/env bash
2 2  
  3 +export CURRENT_UID=$(id -u)
  4 +export COMPUTER_HOSTNAME=$HOSTNAME
  5 +
3 6 abort() {
4 7 echo
5 8 echo "********* !!! ERROR !!! ********"
... ...