Commit 8ca1d24ca37cad2e7eb4c72af7114eabfab5ce56

Authored by Etienne Pallier
1 parent 80d242ea
Exists in dev

quelques commentaires

docker/Dockerfile
@@ -171,6 +171,8 @@ RUN useradd -m -s /bin/bash pyros_user --uid $uid @@ -171,6 +171,8 @@ RUN useradd -m -s /bin/bash pyros_user --uid $uid
171 171
172 # Create the work dir and set permissions as pyros_user 172 # Create the work dir and set permissions as pyros_user
173 RUN mkdir -p /home/pyros_user/app/ && chown -R pyros_user:pyros_user /home/pyros_user/app 173 RUN mkdir -p /home/pyros_user/app/ && chown -R pyros_user:pyros_user /home/pyros_user/app
  174 +
  175 +# cd /home/pyros_user/app
174 WORKDIR /home/pyros_user/app 176 WORKDIR /home/pyros_user/app
175 177
176 # Switch from root to pyros_user 178 # Switch from root to pyros_user
@@ -181,6 +183,8 @@ USER pyros_user @@ -181,6 +183,8 @@ USER pyros_user
181 #RUN pip install --user numpy 183 #RUN pip install --user numpy
182 184
183 # Copy local host machine files to image 185 # Copy local host machine files to image
  186 +# Dockerfile contains this volume => ../..:/home/pyros_user/app
  187 +# Thus, this will copy PYROS_SOFT/* ==TO==> /home/pyros_user/app/ (the WORKDIR)
184 COPY --chown=pyros_user:pyros_user . . 188 COPY --chown=pyros_user:pyros_user . .
185 # Copy some aliases 189 # Copy some aliases
186 RUN cp .bash_aliases .. 190 RUN cp .bash_aliases ..
@@ -192,9 +196,9 @@ ENV PATH "$PATH:/home/pyros_user/.local/bin" @@ -192,9 +196,9 @@ ENV PATH "$PATH:/home/pyros_user/.local/bin"
192 196
193 197
194 # Installing click on the image to prevent error on the first execution of the installation script 198 # Installing click on the image to prevent error on the first execution of the installation script
195 -RUN python3 -m pip install --user click 199 +RUN python3 -m pip install --user click
196 200
197 -RUN python3 -m pip install --user setuptools==58 201 +RUN python3 -m pip install --user setuptools==58
198 202
199 # (EP 23/3/2022) Installing pip-tools for the management of all the requirements*.txt files (python dependencies packages) 203 # (EP 23/3/2022) Installing pip-tools for the management of all the requirements*.txt files (python dependencies packages)
200 # NB : 204 # NB :
@@ -203,14 +207,14 @@ RUN python3 -m pip install --user setuptools==58 @@ -203,14 +207,14 @@ RUN python3 -m pip install --user setuptools==58
203 # - Unfortunatly, it is difficult to use with several requirements*.txt files as it is the case for this software : pyros + sphinx + guitastro... 207 # - Unfortunatly, it is difficult to use with several requirements*.txt files as it is the case for this software : pyros + sphinx + guitastro...
204 # - So we cannot yet use it completely and still have to use the traditional "pip install -r" anyway ... 208 # - So we cannot yet use it completely and still have to use the traditional "pip install -r" anyway ...
205 # - But we can at least use it to generate all the requirements*.txt files in a far better format 209 # - But we can at least use it to generate all the requirements*.txt files in a far better format
206 -RUN python3 -m pip install --user pip-tools 210 +RUN python3 -m pip install --user pip-tools
207 211
208 # Installing packages required for Guitastro 212 # Installing packages required for Guitastro
209 RUN pip-compile ./vendor/guitastro/install/requirements.in 213 RUN pip-compile ./vendor/guitastro/install/requirements.in
210 -RUN python3 -m pip install --user -r ./vendor/guitastro/install/requirements.txt 214 +RUN python3 -m pip install --user -r ./vendor/guitastro/install/requirements.txt
211 # Maybe unnecessary because same requirements as for pyros requirements_dev (?) 215 # Maybe unnecessary because same requirements as for pyros requirements_dev (?)
212 #RUN pip install --user -r ./vendor/guitastro/install/requirements_dev.txt 216 #RUN pip install --user -r ./vendor/guitastro/install/requirements_dev.txt
213 217
214 # Installing packages required for PyROS 218 # Installing packages required for PyROS
215 -RUN python3 -m pip install --user -r ./install/requirements.txt  
216 -RUN python3 -m pip install --user -r ./install/requirements_dev.txt 219 +RUN python3 -m pip install --user -r ./install/requirements.txt
  220 +RUN python3 -m pip install --user -r ./install/requirements_dev.txt
docker/PYROS_DOCKER_BUILD
1 #!/usr/bin/env bash 1 #!/usr/bin/env bash
2 2
3 # Git clone guitastro 3 # Git clone guitastro
  4 +#
4 # This could be done directly in the Dockerfile 5 # This could be done directly in the Dockerfile
5 # but it is better to do it here because if it failed during the build 6 # but it is better to do it here because if it failed during the build
6 # we would have to do all the build again... 7 # we would have to do all the build again...
docker/docker-compose.yml
@@ -111,6 +111,7 @@ services: @@ -111,6 +111,7 @@ services:
111 tty: true 111 tty: true
112 # stdin_open is the -i option in docker exec 112 # stdin_open is the -i option in docker exec
113 stdin_open: true 113 stdin_open: true
  114 + # Local PYROS_SOFT/ folder is linked to container /home/pyros_user/app folder
114 volumes: 115 volumes:
115 - ../..:/home/pyros_user/app 116 - ../..:/home/pyros_user/app
116 # tells which port of local machine can communicate with the docker image (host:container), host is your local machine 117 # tells which port of local machine can communicate with the docker image (host:container), host is your local machine