fix: replace bash -c with sh -c for Alpine compatibility (#22)#25
Open
NeritonDias wants to merge 30 commits intoEvolutionAPI:developfrom
Open
fix: replace bash -c with sh -c for Alpine compatibility (#22)#25NeritonDias wants to merge 30 commits intoEvolutionAPI:developfrom
NeritonDias wants to merge 30 commits intoEvolutionAPI:developfrom
Conversation
…Files - Deleted the tech specification document for OSS community infrastructure setup. - Updated files manifest with new hashes for YAML and configuration files. - Modified IDE configuration for Claude Code with updated last modified date. - Revised manifest.yaml to reflect the latest installation and module update timestamps. - Updated memory and BMM module configuration files with new generation dates. - Adjusted core module configuration file with the latest generation date. - Updated submodule references for evo-ai-frontend-community and evo-auth-service-community to latest commits.
…ferences - Introduced a new service `evo-bot-runtime` in `docker-compose.yml` for the Go/Gin bot, configured to listen on port 8080 with health checks and dependencies on Redis and the AI processor. - Updated submodule references for `evo-ai-core-service-community`, `evo-ai-crm-community`, `evo-ai-frontend-community`, `evo-ai-processor-community`, and `evo-auth-service-community` to their latest commits.
…rocessor-community
The submodule was registered in .gitmodules but never staged, so it appeared as untracked. This properly adds it to the tree. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…rontend-community
…tend-community, and evo-auth-service-community
- Updated .env.example to include BOT_RUNTIME_URL and BOT_RUNTIME_POSTBACK_BASE_URL. - Created GitHub Actions workflow for building and publishing the gateway image. - Updated README.md to reflect the addition of the bot runtime service. - Added docker-compose.swarm.yaml for deploying the stack in Docker Swarm. - Updated docker-compose.yml to include bot runtime configuration. - Added Dockerfile and nginx.conf for the Nginx API gateway. - Updated setup.sh to include bot runtime service URLs in the setup output.
…and update nginx configuration for dynamic service resolution
…ice migration handling and dynamic routing
…ity and response management
…col and add stop grace period for Sidekiq service
…managed by backend services
…r improved service management
…39d3a9a3d606d1469b4b281)
…tend runtime The evo-crm container healthcheck ran curl -f against /auth/sign_in, a legacy Chatwoot endpoint that no longer exists, so the CRM was perpetually marked unhealthy. Any dependent container with a service_healthy condition (notably evo-frontend) then refused to start, freezing make start in a "Waiting" loop. Repointed the healthcheck at /health/live, which the Rails app already exposes and returns 200. The evo-frontend Dockerfile builds the Vite bundle with VITE_*_PLACEHOLDER literals and replaces them at container start via docker-entrypoint.sh using sed on the envs at runtime. The compose file only passed those values as build args, so the runtime envs were empty, the sed was a no-op, and the bundle shipped with raw VITE_AUTH_API_URL_PLACEHOLDER strings. Axios then treated the baseURL as a relative path, POSTs to /auth/sign_in hit the nginx static SPA, and login returned HTTP 405. Added an environment: block that mirrors the build args and also includes VITE_WS_URL (which the actionCableService reads and had no build-time default). Bumps submodule pointers for the four repos touched in this change set.
…ok-config-and-channel-tooltips fix(compose): repair crm healthcheck and inject VITE_* envs into frontend runtime
The Docker images for evo-auth and evo-crm services are built on Alpine Linux (ruby:3.4.4-alpine3.21), which does not ship with bash. Using 'bash -c "..."' in container commands fails at runtime with: docker/entrypoints/rails.sh: exec: line 34: bash: not found exit code 127 The rails.sh entrypoint ends with 'exec "$@"', which tries to execute the command passed via docker-compose 'command:'. When that command starts with 'bash', the exec fails because bash is not installed in the Alpine image. All commands are simple && chains fully compatible with POSIX sh, so the fix is a straight swap of 'bash -c' for 'sh -c' in: - docker-compose.yml (evo-auth, evo-auth-sidekiq) - docker-compose.prod-test.yaml (evo_auth, evo_auth_sidekiq, evo_crm) - docker-compose.swarm.yaml (evo_auth) - setup.sh (db seed commands for evo-auth and evo-crm) - Makefile (seed-auth and seed-crm targets) Fixes EvolutionAPI#22
Reviewer's guide (collapsed on small PRs)Reviewer's GuideReplaces all uses of Sequence diagram for container startup before and after replacing bash with shsequenceDiagram
actor Dev
participant Makefile as Makefile_target
participant Docker as docker_compose
participant Container as Rails_container
participant Entrypoint as rails_sh_entrypoint
participant Shell as shell
Dev->>Makefile: run seed-auth / docker compose up
Makefile->>Docker: docker compose run evo-auth cmd
note over Docker: command: bash -c "bundle exec rails ..." (before)
Docker->>Container: start container with CMD
Container->>Entrypoint: run rails.sh
Entrypoint->>Entrypoint: exec "$@"
Entrypoint->>Shell: exec bash -c "bundle exec rails ..."
Shell-->>Entrypoint: bash not found (exit 127)
Entrypoint-->>Container: process exits
Container-->>Docker: container stops with error
Dev->>Makefile: run seed-auth / docker compose up (after)
Makefile->>Docker: docker compose run evo-auth cmd
note over Docker: command: sh -c "bundle exec rails ..." (after)
Docker->>Container: start container with CMD
Container->>Entrypoint: run rails.sh
Entrypoint->>Entrypoint: exec "$@"
Entrypoint->>Shell: exec sh -c "bundle exec rails ..."
Shell->>Shell: run bundle exec rails db:prepare
Shell->>Shell: run bundle exec rails db:seed or rails s / sidekiq
Shell-->>Entrypoint: commands complete
Entrypoint-->>Container: process stays running (services healthy)
Flow diagram for seeding services using sh -c via Makefile and setup scriptflowchart LR
Dev["Developer runs make setup / make seed-auth / make seed-crm"] --> Makefile["Makefile targets seed-auth and seed-crm"]
Makefile -->|docker compose run --rm evo-auth sh -c 'bundle exec rails db:prepare && bundle exec rails db:seed'| DockerAuth["docker compose run evo-auth"]
Makefile -->|docker compose run --rm evo-crm sh -c 'bundle exec rails db:prepare && bundle exec rails db:seed'| DockerCrm["docker compose run evo-crm"]
Dev --> SetupSh["setup.sh script"]
SetupSh -->|docker compose run --rm evo-auth sh -c 'bundle exec rails db:prepare && bundle exec rails db:seed'| DockerAuth
SetupSh -->|docker compose run --rm evo-crm sh -c 'bundle exec rails db:prepare && bundle exec rails db:seed'| DockerCrm
DockerAuth --> EntrypointAuth["evo-auth rails.sh entrypoint"]
DockerCrm --> EntrypointCrm["evo-crm rails.sh entrypoint"]
EntrypointAuth --> ExecAuth["exec sh -c ..."]
EntrypointCrm --> ExecCrm["exec sh -c ..."]
ExecAuth --> AuthPrepare["bundle exec rails db:prepare"]
AuthPrepare --> AuthSeed["bundle exec rails db:seed"]
AuthSeed --> AuthDone["Auth database seeded"]
ExecCrm --> CrmPrepare["bundle exec rails db:prepare"]
CrmPrepare --> CrmSeed["bundle exec rails db:seed"]
CrmSeed --> CrmDone["CRM database seeded"]
File-Level Changes
Possibly linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
0525fc8 to
4c6778b
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The Docker images for
evo-authandevo-crmservices are built on Alpine Linux (ruby:3.4.4-alpine3.21), which does not ship withbash. Usingbash -c "..."in container commands fails at runtime with:The
rails.shentrypoint ends withexec "$@", which tries to execute the command passed via docker-composecommand:. When that command starts withbash, the exec fails becausebashis not installed in the Alpine image.All affected commands are simple
&&chains fully compatible with POSIXsh, so the fix is a straight swap ofbash -cforsh -c.Files Changed
docker-compose.ymldocker-compose.prod-test.yamldocker-compose.swarm.yamlsetup.shMakefileRoot Cause
FROM ruby:3.4.4-alpine3.21— Alpine ships/bin/sh(BusyBox), not/bin/bashbash -c "..."as the container commanddocker/entrypoints/rails.shline 34 runsexec "$@"which expands toexec bash -c "..."bashbinary doesn't exist in the container → exit code 127Fixes
Closes #22
Test Plan
make setupcompletes successfully withoutbash: not founderrorsmake seed-authruns and seeds the Auth servicemake seed-crmruns and seeds the CRM servicedocker compose upstarts evo-auth and evo-auth-sidekiq correctlydocker compose -f docker-compose.prod-test.yaml upstill workssh(all are POSIX-compatible&&/||/;chains)Summary by Sourcery
Replace bash-based container commands with POSIX sh for compatibility with Alpine-based images.
Bug Fixes:
Enhancements: