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

Bugfix/docker server #1274

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

knighttower
Copy link

Fixes

  • Issues with docker server
  • Removes duplicate "Dockerfiles"
  • Addresses performance issues during dev (by using the new docker container, the app runs a lot faster and with less issues)
  • Simplify the use with docker

New Features

  • quick scripts to use docker via npm scripts
  • auto docker install
  • avoids manual docker installation or weird setups
  • auto yarn install into container
  • scripts to start, stop and cli (enters the docker via bash interactive)
  • optimizes the performance by using dockers features when using node modules and shared folders
  • It auto copies the required files (env and docker-compose)
  • Added quick shortcuts to the scripts so that:
    • npm run docker:start
      • installs, starts and runs the yarn stuff all in one
      • If everything is already installed, it will just start the docker and the flowise
    • npm run docker:stop
      • Stops the correct container
    • npm run docker:cli
      • enters the correct container in bash mode

Usage and instructions

@HenryHengZJ
Copy link
Contributor

thanks for the PR @knighttower !

Few question:

  1. Is it still possible to use the docker-compose way to install Flowise via npm?
  2. Is it still possible to use the root level Dockerfile to build & install Flowise locally?
  3. Does the new method works across different deployments like Render, AWS, DigitalOcean, Azure, GCP - https://docs.flowiseai.com/deployment

@knighttower
Copy link
Author

Hello @HenryHengZJ ,

Q- "Is it still possible to use the docker-compose way to install Flowise via npm?"

A- Short answer, yes. Long answer, I added a new 'script' command to automate all that and avoid confusion and errors. This has been documented in the readme file (https://github.com/knighttower/Flowise/tree/bugfix/docker-server/docker). The new method is simple and fast, devs only have to run npm run docker:start and it will:

  1. Copy the ENV if there is none. (it will skip if there is one present).
  2. Run the docker-compose container.
  3. Install Flowise (it will use the cache via Yarn if it has already been installed and skip the install if so).
  4. Start the Flowiser server.

If anyone still wants or need to install extra stuff, they can use the npm run docker:cli or use standard docker method docker exec -it bash but using the scripts is preferred for simplicity and accuracy.

Q- "Is it still possible to use the root level Dockerfile to build & install Flowise locally?"
A- The container build is always locally to favor offline builds, customization and mostly easy maintenance of the "Dockerfile". I noticed a lot of discrepancies with the previous files and remote Docker image that it is very hard to know which one was the current one.

Q- "Does the new method works across different deployments like Render, AWS, DigitalOcean, Azure, GCP - https://docs.flowiseai.com/deployment"
A- Yes, in any service that allows the use of Docker, it will allow running the Dockerfile. With a Few exceptions where the Dockerfile is not used, like Render, Railway, Replit because they use their own Docker setup and not the Flowise image.

Note that once this PR is merged the docs there need to Updated. They seem to be outdated anyway, so this will be a good push to make updates happen at that end.

For reference: I updated the Readme files of this repo to reflect the new changes:
https://github.com/knighttower/Flowise/blob/bugfix/docker-server/README.md#-docker
https://github.com/knighttower/Flowise/tree/bugfix/docker-server/docker

Let me know if you have any other questions.

Thanks!

@HenryHengZJ
Copy link
Contributor

Reason we have 2 Dockerfiles, 1 for building image locally, and the other 1 for building via docker-compose using image from dockerhub, is because some cloud services dont support docker-compose like you mentioned Render. Will have to test thoroughly across different deployments to verify if they are still working the same. Plus, we will be merging in this PR which introduces new infrastructure change, so might hold off on this PR for a while

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.

2 participants