From d4ff2d67144e9f1d76b0343212141207e8a7647d Mon Sep 17 00:00:00 2001 From: Thomas Sundvoll Date: Thu, 6 Jun 2024 09:37:40 +0200 Subject: [PATCH] Update Dockerfile to utilize pyproject.toml properly --- .dockerignore | 1 + Dockerfile | 14 ++++++++++---- 2 files changed, 11 insertions(+), 4 deletions(-) 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