Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mark client dependencies as devDependencies #3774

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Mukundan314
Copy link

Summary

This change reclassifies client dependencies as devDependencies, resulting in a significant reduction (~100MB) in the Docker image size without affecting functionality.

I needed to mark cross-env as a regular dependency instead of a devDependency as it is used in the backend script which in turn is used by the Dockerfile. Things were working properly before due the client package declaring cross-env as a dependency (incorrectly?). An alternative approach could be to run the backend with node server/index.js (as in Dockerfile.multi) and keep cross-env as a devDependency.

Testing

For testing Dockerfile:

docker build -t ghcr.io/danny-avila/librechat-dev:latest .
docker compose up
# Manually test

For testing Dockerfile.multi:

# Uncomment lines in `deploy-compose.yml` to use local dockerfile
docker compose -f deploy-compose.yml build
docker compose -f deploy-compose.yml up
# Manually test

I also ran both test:client and test:api. Wasn't able to get playwright working properly so didn't run e2e tests.

Test Configuration:

  • Node.js environment on Arch Linux
  • Bun environment on Arch Linux

Checklist

  • My code adheres to this project's style guidelines
  • I have performed a self-review of my own code
  • My changes do not introduce new warnings
  • Local unit tests pass with my changes

@Mukundan314
Copy link
Author

Note that the image size reduction does not apply to the new Dockerfile.multi as it prunes packages in a separate step.

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.

1 participant