From d73adb85d094ee13558e45fc02e2b603be512e5e Mon Sep 17 00:00:00 2001 From: Igor Santos Date: Fri, 1 Nov 2024 16:31:54 -0300 Subject: [PATCH] fix(nossas): change order in build to install requirements --- app/org_nossas/Dockerfile | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/app/org_nossas/Dockerfile b/app/org_nossas/Dockerfile index 48a0ed57..a13b704f 100644 --- a/app/org_nossas/Dockerfile +++ b/app/org_nossas/Dockerfile @@ -3,6 +3,7 @@ FROM node:18-alpine AS node-builder WORKDIR /app +# TODO: Copiar apenas arquivos para o build do node COPY . . WORKDIR /app/tailwind @@ -43,16 +44,18 @@ RUN apt-get update --yes --quiet && apt-get install --yes --quiet --no-install-r # Install the application server. RUN pip install uwsgi django-storages boto3 django-prometheus -# Install the project requirements. -# COPY org_nossas/requirements.txt / -RUN pip install -r org_nossas/requirements.txt - # Use /app folder as a directory where the source code is stored. WORKDIR /app # Copy the source code of the project into the container. COPY --from=node-builder /app ./ +# Install the project requirements. +# Os arquivos do projeto foram copiados em sua totalidade no node-builder e por esse motivo +# essa linha precisa ser executada após trazer os arquivos do node-builder pra esse stage +# em Python +RUN pip install -r org_nossas/requirements.txt + RUN python manage.py collectstatic --noinput --clear -i tailwindcss # Runtime command that executes when "docker run" is called.