How to run the foreman Procfile with the Vite SSR setting in the Kamal Dockerfile? #796
-
Currently, I'm trying to deploy the Rails app with Kamal that consists of Vite/InertiaJS/React/SSR To run SSR as described in this example, https://github.com/ElMassimo/inertia-rails-ssr-template # Dockerfile
...
# CMD ["./bin/prod"]
# or
CMD ["./bin/rails", "server"]
CMD ["./bin/vite", "ssr"]
#!/usr/bin/env sh
if ! gem list foreman -i --silent; then
echo "Installing foreman..."
gem install foreman
fi
exec foreman start -f Procfile "$@" and web: bin/rails s -p 3000
vite: bin/vite ssr I've added the ERROR /usr/local/bundle/ruby/3.1.0/gems/vite_ruby-3.5.0/lib/vite_ruby/cli/ssr.rb:25:in `exec': No such file or directory - node (Errno::ENOENT)
from /usr/local/bundle/ruby/3.1.0/gems/vite_ruby-3.5.0/lib/vite_ruby/cli/ssr.rb:25:in `call'
from /usr/local/bundle/ruby/3.1.0/gems/dry-cli-1.0.0/lib/dry/cli.rb:116:in `perform_registry'
from /usr/local/bundle/ruby/3.1.0/gems/dry-cli-1.0.0/lib/dry/cli.rb:65:in `call'
from /usr/local/bundle/ruby/3.1.0/gems/vite_ruby-3.5.0/exe/vite:12:in `<top (required)>'
from /rails/bin/vite:29:in `load'
from /rails/bin/vite:29:in `<main>' So, how to run
|
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
Just use a base image that includes node, for example https://hub.docker.com/r/timbru31/ruby-node/tags |
Beta Was this translation helpful? Give feedback.
-
I've found the solution, need to add it to # ...
COPY --from=build /usr/local/node/bin /usr/local/node/bin
ENV PATH=/usr/local/node/bin:$PATH Full application example here https://github.com/abratashov/rails-inertia-react-app |
Beta Was this translation helpful? Give feedback.
I've found the solution, need to add it to
Dockerfile
:Full application example here https://github.com/abratashov/rails-inertia-react-app