forked from equinor/isar
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
39 lines (27 loc) · 816 Bytes
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
FROM python:3.10-slim
RUN apt-get update
RUN apt-get install -y git
WORKDIR /app
# Default robot repository
ARG ROBOT_REPOSITORY_CLONE_URL=https://github.com/equinor/isar-robot.git
ENV VIRTUAL_ENV=/venv
RUN python -m venv $VIRTUAL_ENV
ENV PATH="$VIRTUAL_ENV/bin:$PATH"
RUN python -m pip install --upgrade pip
# Install dependencies before ISAR to cache pip installation
RUN mkdir -p src
COPY setup.py README.md ./
RUN pip install .
COPY . .
RUN pip install -e .
RUN pip install git+${ROBOT_REPOSITORY_CLONE_URL}@main
EXPOSE 3000
# Env variable for ISAR to know it is running in docker
ENV IS_DOCKER=true
# Change user to avoid running as root
# User needs to have an explicit guid for radix
RUN useradd -ms /bin/bash --uid 1001 isar
RUN chown -R 1001 /app
RUN chmod 755 /app
USER 1001
CMD python main.py