Blame view

Dockerfile 1.16 KB
a6603b26   Alexis Koralewski   Django and Python...
1
FROM python:3.8
e4c37a1a   Alexis Koralewski   Upgrading mysql v...
2
ARG uid
5357999a   Alexis Koralewski   add Dockerfile
3
4

RUN apt-get update && apt-get install -y \
b183b691   akoralewski   add git on pyros ...
5
    default-mysql-client \
50cbd417   Alexis Koralewski   add nano and vi t...
6
7
8
    git \
    nano \
    vim
b183b691   akoralewski   add git on pyros ...
9
10
11
12

# Get IRAP self signed certificate
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

e4c37a1a   Alexis Koralewski   Upgrading mysql v...
13
RUN echo "$uid" > test.txt
5357999a   Alexis Koralewski   add Dockerfile
14
# adding new user (pyros_user) and creating his home folder
e4c37a1a   Alexis Koralewski   Upgrading mysql v...
15
RUN useradd --create-home --shell /bin/bash pyros_user --uid $uid
5357999a   Alexis Koralewski   add Dockerfile
16
17
18
19
20
21
22
23

# Create the work dir and set permissions as pyros_user 
RUN mkdir -p /home/pyros_user/app/ && chown -R pyros_user:pyros_user /home/pyros_user/app
WORKDIR /home/pyros_user/app

# switch from root to pyros_user
USER pyros_user

a6603b26   Alexis Koralewski   Django and Python...
24
25
26
RUN pip install --user --upgrade pip
RUN pip install --user wheel
RUN pip install --user numpy
5357999a   Alexis Koralewski   add Dockerfile
27
# copy local host machine files to image
699871e9   Alexis Koralewski   adding bin to pat...
28
29
30
31
32
33
34
35
36
37
COPY --chown=pyros_user:pyros_user . .

# adding local/bin to path to avoid pip warning
ENV PATH "$PATH:/home/pyros_user/.local/bin"

# installing click on the image to prevent error on the first execution of the installation script
RUN pip install --user click

# installing packages required for PyROS
RUN pip install --user -r ./install/requirements.txt