SuperAGI icon indicating copy to clipboard operation
SuperAGI copied to clipboard

Enhancing Setup Reliability, Streamlining Deployment, and Improving Compatibility with Remote Hosts and Proxies

Open JPDucky opened this issue 2 years ago • 1 comments

The primary goal of this merge request is to enhance the overall robustness of the setup process and minimize potential issues related to dependency conflicts, port clashes, configuration differences, and hostname problems. Additionally, I've aimed to improve compatibility when running the application on a remote host or behind a proxy.

I made the following changes to achieve these objectives:

  1. Added an Nginx container and a corresponding nginx/default.conf file to handle WebSocket connections for Hot Module Replacement (HMR) and forward HTTP requests to the backend service. Running Nginx within a Docker container provides better compatibility with remote hosts and proxies.

  2. Modified the Docker Compose configuration to only expose the Nginx container's port, which simplifies host machine port exposure and reduces the risk of port conflicts. This setup ensures that all communication to other services goes through the Nginx container, which can access all other services on the same Docker network.

  3. Updated the nginx/default.conf file to correctly proxy the WebSocket connection for HMR. This change will help prevent the application from getting stuck at the initializing screen due to hostname issues.

  4. Removed the unsupported webpackDevMiddleware configuration in next.config.js.

These changes make the setup process more seamless and make sure the project is easy to deploy, regardless of the user's operating system or environment (Linux, macOS, Windows, unconventional environments, etc.). It also streamlines the application's functionality when running on remote hosts or behind proxies.

Lastly, I have updated the documentation to guide users through the streamlined setup process with clear instructions on installing and launching the application using Docker Compose.

JPDucky avatar Jun 14 '23 07:06 JPDucky

@ak-gupta89 Ran bfg and removed all instances of config.yaml, rotated all keys and passwords. Can't believe I missed that. But here is the updated PR, let me know what you think.

JPDucky avatar Jun 14 '23 07:06 JPDucky