diff --git a/.dockerignore b/.dockerignore index 48f82902..25ba2d51 100644 --- a/.dockerignore +++ b/.dockerignore @@ -40,6 +40,12 @@ tests/ .flake8 requirements-dev.txt +# Python specific - don't exclude frontend +!frontend/ +frontend/node_modules/ +frontend/.next/ +frontend/dist/ + # Ambiente virtual venv/ __pycache__/ diff --git a/frontend/Dockerfile b/frontend/Dockerfile index 1d608f0e..fee81f46 100644 --- a/frontend/Dockerfile +++ b/frontend/Dockerfile @@ -6,24 +6,16 @@ WORKDIR /app # Define build arguments with default values ARG NEXT_PUBLIC_API_URL=https://api.evo-ai.co +# Install pnpm globally RUN npm install -g pnpm # Copy package files first for better caching COPY package.json pnpm-lock.yaml ./ -# Copy configuration files that are needed for dependency resolution -COPY tsconfig.json ./ -COPY next.config.mjs ./ -COPY tailwind.config.ts ./ -COPY postcss.config.mjs ./ -COPY components.json ./ - # Install dependencies RUN pnpm install --no-frozen-lockfile -RUN pnpm add next-runtime-env - -# Copy all source code +# Copy all source code (this includes tsconfig.json, lib/, etc.) COPY . . # Set environment variables from build arguments @@ -40,14 +32,13 @@ WORKDIR /app # Define build arguments again for the runner stage ARG NEXT_PUBLIC_API_URL=https://api-evoai.evoapicloud.com +# Install pnpm globally RUN npm install -g pnpm # Install production dependencies only COPY package.json pnpm-lock.yaml ./ RUN pnpm install --prod --no-frozen-lockfile -RUN pnpm add next-runtime-env - # Copy built assets from builder COPY --from=builder /app/.next ./.next COPY --from=builder /app/public ./public