Skip to content

Commit 10b436c

Browse files
Updat docker file in Backend Folder
Signed-off-by: cogniware-devops <ambarish.desai@cogniware.ai>
1 parent bd58b92 commit 10b436c

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

CogniwareIms/backend/Dockerfile

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,11 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
1111
libpq-dev \
1212
&& rm -rf /var/lib/apt/lists/*
1313

14-
# Copy requirements and install dependencies
14+
# Copy requirements and build wheels
15+
# Note: We build wheels WITH dependencies to ensure all packages can build correctly
16+
# The --no-deps flag can fail for packages that need dependencies during build
1517
COPY backend/requirements.txt .
16-
RUN pip wheel --no-cache-dir --no-deps --wheel-dir /build/wheels -r requirements.txt
18+
RUN pip wheel --no-cache-dir --wheel-dir /build/wheels -r requirements.txt
1719

1820
# Production image
1921
FROM python:3.11-slim
@@ -39,9 +41,10 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
3941
WORKDIR /app
4042

4143
# Copy wheels from builder and install
44+
# Install from wheels directory - pip will resolve dependencies from wheels
4245
COPY --from=builder /build/wheels /wheels
4346
COPY --from=builder /build/requirements.txt .
44-
RUN pip install --no-cache /wheels/*
47+
RUN pip install --no-cache-dir --find-links /wheels -r requirements.txt
4548

4649
# Copy application code
4750
COPY --chown=appuser:appuser backend/app ./app

0 commit comments

Comments
 (0)