diff --git a/.dockerignore b/.dockerignore index 89e6fcb6..d284625e 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,4 +1,5 @@ * +!.git/ !src/isar !src/robot_interface !main.py diff --git a/Dockerfile b/Dockerfile index f052a657..6c8255fc 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,15 +1,21 @@ FROM python:3.12-slim AS builder WORKDIR /app -RUN apt-get update -RUN apt-get install -y --no-install-recommends build-essential gcc -RUN python -m pip install --upgrade pip RUN python -m venv /opt/venv ENV PATH="/opt/venv/bin:$PATH" -# Install dependencies before ISAR to cache pip installation +RUN apt-get update && apt-get install -y git +RUN apt-get install -y --no-install-recommends build-essential gcc +RUN python -m pip install --upgrade pip + +# Install dependencies before isar to cache pip installation +COPY requirements.txt . +RUN pip install -r requirements.txt + +# Install isar COPY . . +RUN --mount=source=.git,target=.git,type=bind RUN pip install . # Install the base isar-robot package