aboutsummaryrefslogtreecommitdiffstats
path: root/Dockerfile
diff options
context:
space:
mode:
authorGravatar Joe Banks <[email protected]>2024-07-30 12:50:21 +0100
committerGravatar GitHub <[email protected]>2024-07-30 12:50:21 +0100
commit396632c745df72861b4f3cef27133bc82b0ac27a (patch)
treecc1e7423998915860479a2298f557ebad7f644a3 /Dockerfile
parentDisable caching of FreeIPA client (diff)
parentOnly install LDAP group in wheel build stage (diff)
Merge pull request #250 from python-discord/ldap-deps-group
Ldap deps group
Diffstat (limited to 'Dockerfile')
-rw-r--r--Dockerfile11
1 files changed, 8 insertions, 3 deletions
diff --git a/Dockerfile b/Dockerfile
index 4701510..2fced88 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -6,17 +6,22 @@ FROM --platform=linux/amd64 ghcr.io/owl-corp/python-poetry-base:$python_version
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
+
+# Only the LDAP group has deps that requires gcc, so only build that for now
+RUN poetry install --only ldap --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 the pre-built LDAP group from the build stage that required gcc
COPY --from=wheel-builder /opt/poetry/cache /opt/poetry/cache
+
+# Install the rest of the dependencies
COPY pyproject.toml poetry.lock ./
-RUN poetry install --without dev --no-root
+RUN poetry install --without dev --with ldap --no-root
# Set Git SHA environment variable for Sentry
ARG git_sha="development"