The --remove-orphans flag was killing Supabase and Dify containers
because their compose files were not included when starting local AI
services. Now we include them conditionally if they are enabled.
- remove quick start mode from wizard, always show service selection
- add --wait flag to docker compose up for proper sequencing
- remove hardcoded time.sleep delays in favor of --wait
- clean up unused imports
switching project name from 'localai' to directory-based naming would
cause users to lose all data stored in docker volumes (workflows,
databases, configs) since volumes are prefixed with project name
update configure services to call generate_n8n_workers.sh instead of
prompting for separate runner count. update start_services.py and
apply_update.sh to include docker-compose.n8n-workers.yml when present.
- Updated .env.example to remove deprecated DIFY_NGINX_PORT and streamline Dify application settings.
- Changed reverse proxy port for Dify in Caddyfile from 80 to 8080 for consistency with new configuration.
- Enhanced start_services.py with new functions to check Dify integration, clone the repository, and prepare the environment, ensuring proper setup and configuration of Dify services.
- Added DIFY_EXPOSE_NGINX_PORT and DIFY_EXPOSE_NGINX_SSL_PORT to .env.example for improved NGINX configuration.
- Updated start_services.py to set and append these new variables, ensuring backward compatibility with DIFY_NGINX_PORT.
- Enhanced logic to prevent port conflicts by checking and setting the new exposure ports in the generated .env file.
- Updated clone_dify_repo to include both the docker directory and root .env.example during sparse checkout.
- Refactored prepare_dify_env to create a dedicated function for preparing the .env file, improving modularity.
- Enhanced error handling and added warnings for missing directories.
- Implemented logic to create a basic .env if .env.example is not found, ensuring a smoother setup process.
- Removed deprecated DIFY_DB and DIFY_CELERY_BROKER_URL variables from .env.example.
- Updated Caddyfile to change the reverse proxy port for Dify from 80 to 8080.
- Enhanced start_services.py to dynamically set NGINX_PORT to prevent port conflicts.
- Updated prepare_dify_env function to copy .env.example to .env and add the DIFY_SECRET_KEY from the main .env file.
- Improved error handling and added warnings for missing files.
- Created a fallback mechanism to generate a basic .env configuration if .env.example is not found.
- Updated start_services.py to include checks for the Dify Docker Compose file, ensuring proper service shutdown.
- Corrected the Docker Compose file extension from .yml to .yaml in the start_dify function for compatibility.
- Revised activeContext.md and progress.md to reflect the completion and archiving of the Dify AI Platform integration task.
- Created a comprehensive archive document detailing the integration process, challenges, and lessons learned.
- Updated reflection document to capture insights and improvements for future integrations.
- Integrated Dify, an open-source AI application development platform, as an optional service in the n8n-installer project.
- Updated start_services.py to include functions for cloning the Dify repository, preparing the environment, and starting Dify services.
- Configured docker-compose.yml to reference Dify's external Docker Compose file and included necessary environment variables.
- Enhanced Caddyfile with reverse proxy settings for Dify, ensuring proper routing and access.
- Updated .env.example to include Dify-specific configuration variables.
- Revised README.md to document Dify's capabilities and access details.
- Enhanced service selection wizard to allow users to choose Dify during setup.
- Comprehensive testing and validation phase pending to ensure full functionality.
- Updated the start_local_ai function to first build services and pull newer base images before starting the containers. This ensures that the latest changes are applied and improves the deployment process.
- Modified the command in start_local_ai function to include the --build flag, ensuring that local AI services are rebuilt each time they are started, which helps in applying the latest changes to the services.
- Introduced a new function, get_all_profiles, to extract profile names from the docker-compose.yml file.
- Updated the stop_existing_containers function to include all profiles when stopping services, ensuring a comprehensive shutdown of all relevant containers.
- Added the yaml module to handle YAML file parsing.
- Updated system preparation script to install python3-yaml package for YAML support.
- Updated the logic to check for the existence of the Supabase Docker Compose file before including it in the 'down' command.
- This change ensures that Supabase services are properly stopped even if they were disabled in the .env file during the last run.
* docker-composer.yml: Remove trailing whitespace.
Signed-off-by: Elvis Dowson <elvis.dowson@gmail.com>
* .env.example: Trim training whitespace.
Signed-off-by: Elvis Dowson <elvis.dowson@gmail.com>
* start_services.py: Trim training whitespace.
Signed-off-by: Elvis Dowson <elvis.dowson@gmail.com>
---------
Signed-off-by: Elvis Dowson <elvis.dowson@gmail.com>
- Eliminated the code that commented out logflare sink entries in vector.yml, streamlining the repository setup process.
- This change improves clarity and reduces unnecessary complexity in the service initialization script.
- Added logic to comment out logflare sink entries in vector.yml to disable logflare sinks, improving configuration management.
- Included warnings for missing vector.yml file to enhance user feedback during the hotfix process.
- Modified the cap_drop directive in the Docker Compose configuration to ensure correct multi-line YAML format.
- Added a note to re-enable the cap_drop directive after the first run for enhanced security.
- Updated the is_supabase_enabled function to read COMPOSE_PROFILES from the .env file instead of os.environ, improving clarity.
- Simplified the run_command function by removing the unused env parameter.
- Refined the stop_existing_containers function to streamline the shutdown process for the 'localai' project, conditionally including the Supabase compose file.
- Enhanced logging for better user feedback during service management operations.
- Adjusted the scripts for generating secrets and applying updates to improve clarity and functionality.
- Updated the stop_existing_containers function to conditionally include the Supabase compose file only if Supabase is enabled, improving clarity and functionality.
- Added logging to inform users about the presence or absence of the Supabase compose file, enhancing the shutdown process.
- Included checks for the existence of the Supabase compose file to provide context when Supabase is disabled, ensuring better user feedback.
- Introduced a new function, force_stop_lingering_containers, to identify and force stop containers that may be running outside of the current Docker Compose management.
- Implemented logic to check for specific container patterns and handle stopping and removing them, enhancing the shutdown process.
- Improved error handling to manage potential issues during the force stop operation, ensuring robustness in service management.
- Updated the stop_existing_containers function to explicitly remove the COMPOSE_PROFILES environment variable when stopping and removing containers, ensuring all services are affected.
- Improved clarity by modifying the environment passed to run_command for both stop and remove operations, enhancing the shutdown process consistency.
- Updated the stop_existing_containers function to explicitly stop and remove all existing containers for the 'localai' project.
- Enhanced logging to provide clearer messages regarding the presence of the Supabase compose file during the shutdown process.
- Separated the stop and remove commands for better readability and maintainability of the shutdown logic.
- Modified the run_command function to include an optional env parameter, allowing explicit environment variable management during subprocess execution.
- Updated calls to run_command throughout the script to pass os.environ.copy(), ensuring the correct COMPOSE_PROFILES are used for service operations.
- Removed outdated comments regarding COMPOSE_PROFILES manipulation, reflecting the current environment handling approach.
- Updated the 'down' command to always include the Supabase compose file if it exists, ensuring proper shutdown of services.
- Removed the temporary clearing of COMPOSE_PROFILES, as the current environment is now managed by load_dotenv().
- Enhanced logging to inform users about the presence or absence of the Supabase compose file during shutdown.
- Enhanced the 'down' command to conditionally include the Supabase compose file based on the current environment settings.
- Implemented temporary clearing of COMPOSE_PROFILES to ensure all services are affected during shutdown.
- Added error handling to restore the original COMPOSE_PROFILES after command execution, maintaining environment integrity.
- Added load_dotenv() to load environment variables from the .env file, ensuring that COMPOSE_PROFILES is retrieved from the environment.
- Updated the is_supabase_enabled() function to check for 'supabase' in the environment variable instead of directly from the .env file.
- Improved the documentation to clarify the reliance on environment variables for service configuration.
- Added functionality to check if Supabase is enabled via the .env file before cloning the repository and preparing the environment.
- Updated the command execution flow to conditionally include Supabase in the Docker commands based on its enabled status.
- Enhanced the service selection wizard in 04_wizard.sh to include Supabase as an option for user selection.
- Removed the profile argument from the start_local_ai function to simplify the service startup process.
- Updated the main function to call start_local_ai without the profile parameter, streamlining the command execution.
- Ensure docker exec does not fail hard when checking uwsgi.ini existence
- Improve robustness of first-run detection for SearXNG service
- Small cosmetic improvements to startup logs
- No functional changes if container and file detection succeeds
Extended Description:
- Use 'include:' in docker-compose.yml to properly merge Supabase services.
- Update start_services.py to pass --profile during container shutdown to prevent orphan containers and leftover networks.
- Update README upgrade instructions to reflect these changes.
- This fixes the orphan containers, stuck 'localai_default' network, and incomplete Ollama container updates.
This change ensures clean startup/shutdown cycles and improves reliability without increasing complexity.