Skip to content

Conversation

@ItzNotABug
Copy link
Member

@ItzNotABug ItzNotABug commented Jul 21, 2025

What does this PR do?

This PR does the following -

  1. Update Dockerfile with more stages to slim the sizes
  2. Parallelize node ops for faster docs creation, 88 seconds to <5 seconds now!
  3. Remove .git to shave off another 500MB for a smaller image size
    • Once the final git checkout {BRANCH} is done, we don't really need the .git folder IMO.
  4. Bump examples and releases to use cloud and not 1.6.x

Final image size can be just around ~200MB now.

Screenshot 2025-07-21 at 11 17 17 AM

Test Plan

Manual.
Ran pnpm test, updated the same examples here in the PR as well.

Related PRs and Issues

N/A.

Have you read the Contributing Guidelines on issues?

Yes.

@ItzNotABug ItzNotABug self-assigned this Jul 21, 2025
@ItzNotABug ItzNotABug requested review from ChiragAgg5k and loks0n July 21, 2025 04:33
@ChiragAgg5k ChiragAgg5k requested a review from Copilot July 21, 2025 04:37
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR optimizes the Appwrite assistant by implementing several Docker and build improvements to reduce image size and increase build performance. The changes focus on switching to a lighter base image, parallelizing operations, removing unnecessary files, and updating version references.

  • Docker optimization: Switched from node:18-alpine to node:18-slim and removed .git folder to reduce final image size by ~675-700MB
  • Performance improvement: Parallelized document processing operations, reducing build time from 88 seconds to under 5 seconds
  • Version updates: Updated references from 1.6.x to cloud across examples, releases, and configuration files

Reviewed Changes

Copilot reviewed 18 out of 18 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
Dockerfile Optimized base image and multi-stage build process for smaller final image
src/documents.js Parallelized documentation and reference fetching with Promise.all
scripts/web-sources.js Parallelized SDK and service downloads, added error handling
src/embeddings.js Fixed typo in function name from intializeDocumentRetriever to initializeDocumentRetriever
src/main.js Updated import to use corrected function name
.github/workflows/*.yml Updated build arguments to use cloud version instead of 1.6.x
CONTRIBUTING.md Updated documentation examples to use cloud version
package.json Added new make-sources script
scripts/git-sources.js Added removal of .git directory after checkout
scripts/test-prompts.js Added new test prompt for static website hosting
tests/*.md Updated test documentation content with newer information and corrected references

@loks0n loks0n merged commit 4d47510 into main Jul 21, 2025
3 checks passed
@ItzNotABug ItzNotABug deleted the optimize branch July 21, 2025 09:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants