Commit 683fc05b7cbafcfae54e40767ef5388267b3bd4b

Authored by Alain Klotz
2 parents 16da961d 63f2beb2
Exists in dev

Merge branch 'dev' of https://gitlab.irap.omp.eu/pyros-irap/pyros into dev

.dockerignore renamed to docker/.dockerignore
docker/.env-sample
... ... @@ -7,20 +7,32 @@
7 7 # * The PYROS_DOCKER_BUILD of PyROS with Docker.
8 8 # ============================================================
9 9  
  10 +
10 11 # === MySQL variables (change them only if you do not use Docker)
11   -# any value as password without any space
12   -MYSQL_ROOT_PASSWORD=root
13   -# define the name of the root account (when not using Docker)
  12 +
  13 +# Root login : define the name of the root account (when not using Docker)
14 14 MYSQL_ROOT_LOGIN=root
15   -# define mysql tcp port (default is 3306)
  15 +
  16 +# Root Password : any value as password without any space
  17 +MYSQL_ROOT_PASSWORD=root
  18 +
  19 +# TCP Port - define mysql tcp port (default is 3306)
16 20 MYSQL_TCP_PORT=3306
  21 +
17 22 # define login for superadmin user
18 23 MYSQL_PYROS_LOGIN=pyros
  24 +
19 25 # define password for superadmin user
20 26 MYSQL_PYROS_PWD=DjangoPyros
21   -# Define the local port where you will access the website. When using Docker, we will bind the same port within the docker network and your local port.
  27 +
  28 +
  29 +# === Other variables
  30 +
  31 +# Webserver Local port - define the port where you will access the website. When using Docker, we will bind the same port within the docker network and your local port.
22 32 PYROS_WEBSITE_PORT=8000
  33 +
23 34 # Webserver Host name
24 35 WEBSERVER_HOST_NAME=localhost
25   -# PORT PHPMYADMIN
  36 +
  37 +# PhpMyAdmin Port
26 38 PHPMYADMIN_PORT=8081
27 39 \ No newline at end of file
... ...
docker/Dockerfile
... ... @@ -106,6 +106,8 @@ RUN apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 487CEC2B3F
106 106 #RUN apt-key adv --keyserver http://ppa.launchpad.net/mutlaqja/ppa/ubuntu/dists/jammy --recv-keys 487CEC2B3F33A288
107 107 #RUN apt-key adv --keyserver hkp://pool.sks-keyservers.net:80 --recv-keys 487CEC2B3F33A288
108 108 #10 1.751 E: The repository 'http://ppa.launchpad.net/mutlaqja/ppa/ubuntu jammy InRelease' is not signed.
  109 +
  110 +# INDI
109 111 RUN apt-get update
110 112 RUN apt-get install -y indi-full
111 113 RUN apt-get install -y kstars-bleeding libindi1 indi-bin swig libz3-dev libcfitsio-dev libnova-dev libindi-dev
... ...
Dockerfile-django2 renamed to docker/Dockerfile-django2
docker/PYROS_DOCKER_BUILD.sh renamed to docker/PYROS_DOCKER_BUILD
  1 +#!/usr/bin/env bash
1 2  
2 3 [ ! -d "../vendor/guitastro/" ] && git clone https://gitlab.irap.omp.eu/guitastrolib/guitastro.git ../vendor/guitastro/
3 4  
4 5 export CURRENT_UID=$(id -u)
5 6  
6   -if [ $CURRENT_UID -eq 0 ]
7   -then
8   -echo "You can't run this script as root, use a normal user"
9   -exit 1
10   -else
11   -docker compose build
  7 +# exit if root
  8 +if [ $CURRENT_UID -eq 0 ] ; then
  9 + echo "You can't run this script as root, use a normal user"
  10 + exit 1
12 11 fi
13 12  
  13 +# BUILD
  14 +docker compose build
  15 +
... ...
docker/PYROS_DOCKER_INSTALL renamed to docker/PYROS_DOCKER_INSTALL_DB
... ... @@ -3,7 +3,8 @@
3 3 # if no container is running
4 4 if ! [ $(docker ps | grep 'pyros' | wc -l) -eq 4 ] ; then
5 5 echo "pyros-db or pyros weren't running, starting them..."
6   - ./PYROS_DOCKER_START.bat
  6 + ./PYROS_DOCKER_START
  7 + #./PYROS_DOCKER_START.bat
7 8 fi
8 9  
9 10 # while db container isn't ready to execute queries, wait 5 seconds
... ...
docker/PYROS_DOCKER_INSTALL.bat renamed to docker/PYROS_DOCKER_INSTALL_DB.bat
docker/PYROS_DOCKER_RUN
... ... @@ -4,7 +4,8 @@
4 4 if ! [ $(docker ps | grep 'pyros' | wc -l) -eq 4 ]
5 5 then
6 6 echo "pyros-db or pyros weren't running, starting them..."
7   - ./PYROS_DOCKER_START.bat
  7 + ./PYROS_DOCKER_START
  8 + #./PYROS_DOCKER_START.bat
8 9 fi
9 10  
10 11 echo "LOG files :"
... ...
docker/PYROS_DOCKER_RUN_WEBSERVER_ONLY
... ... @@ -3,7 +3,8 @@
3 3 #if no container is running
4 4 if ! [ $(docker ps | grep 'pyros' | wc -l) -eq 4 ] ; then
5 5 echo "pyros-db or pyros weren't running, starting them..."
6   - ./PYROS_DOCKER_START.bat
  6 + ./PYROS_DOCKER_START
  7 + #./PYROS_DOCKER_START.bat
7 8 fi
8 9  
9 10 docker compose exec pyros python3 pyros.py -d start webserver $@
... ...
docker/PYROS_DOCKER_SHELL
... ... @@ -4,7 +4,8 @@
4 4 if ! [ $(docker ps | grep 'pyros' | wc -l) -eq 4 ]
5 5 then
6 6 echo "pyros-db or pyros weren't running, starting them..."
7   - ./PYROS_DOCKER_START.bat
  7 + ./PYROS_DOCKER_START
  8 + #./PYROS_DOCKER_START.bat
8 9 fi
9 10 docker compose exec pyros bash $@
10 11  
... ...
docker/PYROS_DOCKER_START.sh renamed to docker/PYROS_DOCKER_START
  1 +#!/usr/bin/env bash
  2 +
  3 +# We need these variables for the build and when we launch 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...
1 5 export CURRENT_UID=$(id -u)
2 6 export COMPUTER_HOSTNAME=$HOSTNAME
3 7  
... ... @@ -7,7 +11,10 @@ docker compose down --remove-orphans
7 11  
8 12 echo
9 13 echo "Then START:"
  14 +# Take docker-compose.yml folder name ("docker") as containers group name in Docker Desktop by default
10 15 docker compose up -d
  16 +# Change this group name with -p option
  17 +#docker compose -p pyros-app up -d
11 18  
12 19 # See started containers
13 20 echo
... ...
docker/PYROS_DOCKER_STOP.bat
  1 +#!/usr/bin/env bash
  2 +
1 3 export CURRENT_UID=$(id -u)
2 4 docker compose down
3 5  
... ...
docker/PYROS_DOCKER_TEST
... ... @@ -4,7 +4,8 @@
4 4 if ! [ $(docker ps | grep 'pyros' | wc -l) -eq 4 ]
5 5 then
6 6 echo "pyros-db or pyros weren't running, starting them..."
7   - ./PYROS_DOCKER_START.bat
  7 + ./PYROS_DOCKER_START
  8 + #./PYROS_DOCKER_START.bat
8 9 fi
9 10 docker compose exec pyros python3 pyros.py test $@
10 11  
... ...
docker/PYROS_DOCKER_UPDATE
... ... @@ -4,7 +4,8 @@
4 4 if ! [ $(docker ps | grep 'pyros' | wc -l) -eq 4 ]
5 5 then
6 6 echo "pyros-db or pyros weren't running, starting them..."
7   - ./PYROS_DOCKER_START.bat
  7 + ./PYROS_DOCKER_START
  8 + #./PYROS_DOCKER_START.bat
8 9 fi
9 10  
10 11 # 1) Update Guitastro
... ...
docker/docker-compose.yml
1 1 version: "3.9"
2 2  
  3 +name: pyros-app
  4 +
3 5 services:
4 6  
5 7 #######################
... ... @@ -72,8 +74,10 @@ services:
72 74 # PyROS will later be installed on this image with "pyros.py install" (PYROS_DOCKER_INSTALL)
73 75 ######################################################
74 76 pyros:
75   - container_name: pyros
76   - restart: always
  77 + container_name: pyros-main
  78 + restart: always
  79 + # For tnc only
  80 + #image: pyros-user:1.0
77 81 #read_only: true
78 82 # app/pyros is equivalent to your PYROS_SOFT/PYROS/ directory
79 83 # Change "pyros" to whatever you want for the PYROS/ dir name (if you do not want "PYROS")
... ... @@ -97,7 +101,11 @@ services:
97 101 args:
98 102 uid: ${CURRENT_UID}
99 103 context: ..
  104 + # For tnc only
  105 + #dockerfile: ./docker/Dockerfile-pyros_user
100 106 dockerfile: ./docker/Dockerfile
  107 + tags:
  108 + - "pyros-core:1.0"
101 109 hostname: ${COMPUTER_HOSTNAME}
102 110 # tty is the -t option in docker exec
103 111 tty: true
... ...