LibreChat/docs/dev
Danny Avila 32281d1b8d
wip: testing container workflows and deployment images (#715)
* feat: add Dockerfile.multi for building API, Client, and Data Provider

feat: add nginx.conf for client-side routing in Nginx

feat: add deploy-compose.yml for deploying the application with Docker Compose

chore: update version in deploy-compose.yml to 3.8

chore: remove unused configuration in docs/dev/deploy-compose.yml

* chore(Dockerfile.multi): Remove data-provider build stage
chore(deploy-compose.yml): Add NODE_ENV=production environment variable

* chore(Dockerfile.multi): add environment variable NODE_OPTIONS with value "--max-old-space-size=776"
feat(Dockerfile.multi): copy client build output to api build stage

* chore(Dockerfile.multi): update NODE_OPTIONS to increase max-old-space-size to 2048
chore(deploy-compose.yml): remove NODE_ENV=production environment variable

* feat(dev-images.yml): add GitHub Actions workflow for Docker multi-stage build on push to main branch
2023-07-27 16:24:06 -04:00
..
deploy-compose.yml wip: testing container workflows and deployment images (#715) 2023-07-27 16:24:06 -04:00
Dockerfile-app update: "documents" folder to "docs" (#391) 2023-05-27 07:03:28 -04:00
eslintrc-stripped.js ci(backend-review.yml): add linter step to the backend review workflow (#625) 2023-07-14 09:36:49 -04:00
meilisearch.yml update: "documents" folder to "docs" (#391) 2023-05-27 07:03:28 -04:00
README.md feat: docker-compose deployment file (#706) 2023-07-26 12:57:26 -04:00
single-compose.yml feat(config/update.js): add support for updating with single-compose file (#680) 2023-07-21 21:51:35 -04:00

Dev

This directory contains files used for developer work

Dockerfile-app:

  • used to build the DockerHub image

eslintrc-stripped.js:

  • alternate linting rules, used in development

meilisearch.yml:

  • Dockerfile for building meilisearch image independently from project

single-compose.yml:

  • Dockerfile for building app image without meilisearch and mongodb services
    • This is useful for deploying on Google, Azure, etc., as a single, leaner container.
  • From root dir of the project, run docker-compose -f ./docs/dev/single-compose.yml up --build
    • When you don't need to build, run docker-compose -f ./docs/dev/single-compose.yml up
  • This requires you use a MongoDB Atlas connection string for the MONGO_URI env var
    • A URI string to a mongodb service accessible to your container is also possible.
    • Remote Meilisearch may also be possible in the same manner, but is not tested.

deploy-compose.yml:

  • Similar to above, but with basic configuration for deployment to a cloud provider where multi-container compose works
    • Tested and working on a $6 droplet on DigitalOcean, just by visiting the http://server-ip/9000.
    • Not a scalable solution, but ideal for quickly hosting on a remote linux server.
    • You should adjust server_name localhost; to match your domain name, replacing localhost, as needed.
  • From root dir of the project, run docker-compose -f ./docs/dev/deploy-compose.yml up --build
    • When you don't need to build, run docker-compose -f ./docs/dev/deploy-compose.yml up
  • Unlike the single-compose file, this containerizes both MongoDB and Meilisearch, as they are already setup for you.