Dockerfile
1.06 KB
FROM python:3.6.9
RUN apt-get update && apt-get install -y \
default-mysql-client \
git \
nano \
vim
# 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
RUN pip install --upgrade pip
# adding new user (pyros_user) and creating his home folder
RUN useradd --create-home --shell /bin/bash pyros_user
# 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
# copy local host machine files to image
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