From 06f958c9748ddd7a4dea9f577a04582f982877a6 Mon Sep 17 00:00:00 2001 From: michael Date: Wed, 8 Oct 2025 17:06:41 -0500 Subject: [PATCH] fixed docker file for dependency installs --- backend/Dockerfile | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/backend/Dockerfile b/backend/Dockerfile index 7750671..5309fba 100644 --- a/backend/Dockerfile +++ b/backend/Dockerfile @@ -31,10 +31,9 @@ WORKDIR /app # Copy dependency files COPY pyproject.toml poetry.lock ./ -# Install dependencies (using pip for simpler container) -# Export to requirements.txt and install with pip for smaller image -RUN poetry export -f requirements.txt --output requirements.txt --without-hashes \ - && pip install --no-cache-dir --user -r requirements.txt \ +# Install dependencies using Poetry directly (simpler and more reliable) +RUN poetry config virtualenvs.create false \ + && poetry install --only main --no-interaction --no-ansi \ && rm -rf $POETRY_CACHE_DIR # ----------------------------------------------------------------------------- @@ -54,12 +53,12 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ RUN groupadd --gid 1000 app \ && useradd --uid 1000 --gid app --shell /bin/bash --create-home app -# Copy Python packages from builder -COPY --from=builder /root/.local /home/app/.local +# Copy Python packages from builder (installed globally, not in user dir) +COPY --from=builder /usr/local/lib/python3.11/site-packages /usr/local/lib/python3.11/site-packages +COPY --from=builder /usr/local/bin /usr/local/bin -# Set PATH to include user packages -ENV PATH="/home/app/.local/bin:$PATH" \ - PYTHONPATH=/app \ +# Set environment variables +ENV PYTHONPATH=/app \ PYTHONUNBUFFERED=1 \ PYTHONDONTWRITEBYTECODE=1