Commit 2be8242aace747f4fd9ea2da824ce38582b15414

Authored by Etienne Pallier
1 parent 64fe9f0c
Exists in dev

Ajout du shebang dans les scripts PYROS_DOCKER_ shell pour demarrage auto en bash

docker/Dockerfile-django2 0 → 100644
@@ -0,0 +1,36 @@ @@ -0,0 +1,36 @@
  1 +FROM python:3.8
  2 +
  3 +RUN apt-get update && apt-get install -y \
  4 + default-mysql-client \
  5 + git \
  6 + nano \
  7 + vim
  8 +
  9 +# Get IRAP self signed certificate
  10 +RUN echo | openssl s_client -connect gitlab.irap.omp.eu:443 -servername gitlab.irap.omp.eu 2>/dev/null | openssl x509 > /etc/ssl/certs/gitlab.irap.omp.eu.crt
  11 +
  12 +
  13 +# adding new user (pyros_user) and creating his home folder
  14 +RUN useradd --create-home --shell /bin/bash pyros_user
  15 +
  16 +# Create the work dir and set permissions as pyros_user
  17 +RUN mkdir -p /home/pyros_user/app/ && chown -R pyros_user:pyros_user /home/pyros_user/app
  18 +WORKDIR /home/pyros_user/app
  19 +
  20 +# switch from root to pyros_user
  21 +USER pyros_user
  22 +
  23 +RUN pip install --user --upgrade pip
  24 +RUN pip install --user wheel
  25 +RUN pip install --user numpy
  26 +# copy local host machine files to image
  27 +COPY --chown=pyros_user:pyros_user . .
  28 +
  29 +# adding local/bin to path to avoid pip warning
  30 +ENV PATH "$PATH:/home/pyros_user/.local/bin"
  31 +
  32 +# installing click on the image to prevent error on the first execution of the installation script
  33 +RUN pip install --user click
  34 +
  35 +# installing packages required for PyROS
  36 +RUN pip install --user -r ./install/requirements_django2.txt
0 \ No newline at end of file 37 \ No newline at end of file
docker/PYROS_DOCKER_BUILD.sh
  1 +#!/usr/bin/env bash
1 2
2 [ ! -d "../vendor/guitastro/" ] && git clone https://gitlab.irap.omp.eu/guitastrolib/guitastro.git ../vendor/guitastro/ 3 [ ! -d "../vendor/guitastro/" ] && git clone https://gitlab.irap.omp.eu/guitastrolib/guitastro.git ../vendor/guitastro/
3 4
docker/PYROS_DOCKER_START.sh
  1 +#!/usr/bin/env bash
  2 +
1 # We need these variables for the build and when we launch the containers 3 # We need these variables for the build and when we launch the containers
2 # But then, we do not need them anymore. Anyway they are referenced in the docker-compose.yml but it does not find them in memory => makes a warning when using the containers... 4 # But then, we do not need them anymore. Anyway they are referenced in the docker-compose.yml but it does not find them in memory => makes a warning when using the containers...
3 export CURRENT_UID=$(id -u) 5 export CURRENT_UID=$(id -u)
@@ -10,9 +12,9 @@ docker compose down --remove-orphans @@ -10,9 +12,9 @@ docker compose down --remove-orphans
10 echo 12 echo
11 echo "Then START:" 13 echo "Then START:"
12 # Take docker-compose.yml folder name ("docker") as containers group name in Docker Desktop by default 14 # Take docker-compose.yml folder name ("docker") as containers group name in Docker Desktop by default
13 -#docker compose up -d 15 +docker compose up -d
14 # Change this group name with -p option 16 # Change this group name with -p option
15 -docker compose -p pyros-app up -d 17 +#docker compose -p pyros-app up -d
16 18
17 # See started containers 19 # See started containers
18 echo 20 echo
docker/PYROS_DOCKER_STOP.bat
  1 +#!/usr/bin/env bash
  2 +
1 export CURRENT_UID=$(id -u) 3 export CURRENT_UID=$(id -u)
2 docker compose down 4 docker compose down
3 5