aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Joe Banks <[email protected]>2024-07-26 20:04:06 +0100
committerGravatar Joe Banks <[email protected]>2024-07-26 20:27:22 +0100
commit0bb3c88e710af770b8a0ab27760ccf439eb40939 (patch)
treeab33cbbf0934046f63a2af3a2ad74fe797abe473
parentInstall LDAP dependencies in lint workflow (diff)
Add LDAP native libraries to Dockerfile
-rw-r--r--Dockerfile14
1 files changed, 12 insertions, 2 deletions
diff --git a/Dockerfile b/Dockerfile
index 128b9c5..4701510 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -1,10 +1,20 @@
-FROM --platform=linux/amd64 ghcr.io/owl-corp/python-poetry-base:3.12-slim
+ARG python_version=3.12-slim
+
+FROM --platform=linux/amd64 ghcr.io/owl-corp/python-poetry-base:$python_version AS wheel-builder
# Install build dependencies
-RUN apt-get update && apt-get install --no-install-recommends -y libmagickwand-dev && apt autoclean && rm -rf /var/lib/apt/lists/*
+RUN apt-get update && apt-get install --no-install-recommends -y libldap2-dev libsasl2-dev gcc && apt autoclean && rm -rf /var/lib/apt/lists/*
+
+COPY pyproject.toml poetry.lock ./
+RUN poetry install --without dev --no-root
+
+FROM --platform=linux/amd64 ghcr.io/owl-corp/python-poetry-base:$python_version
+
+RUN apt-get update && apt-get install --no-install-recommends -y libmagickwand-dev && rm -rf /var/lib/apt/lists/*
# Install project dependencies
WORKDIR /app
+COPY --from=wheel-builder /opt/poetry/cache /opt/poetry/cache
COPY pyproject.toml poetry.lock ./
RUN poetry install --without dev --no-root