2

I need to pass the next command to my service in docker-compose.uffizzi.yml

bundle exec rails db:create db:migrate db:seed && bundle exec rails s -b 0.0.0.0 -p 3000

According to this doc: https://docs.uffizzi.com/references/compose-spec/#command

command can be passed as usual or converted to an array of strings.

But when I use it in such way I get the next error:

Error: failed to create containerd task: OCI runtime create failed: container_linux.go:380: starting container process caused: exec: "bundle exec rails db:create db:migrate db:seed && bundle exec rails s -b 0.0.0.0 -p 3000": executable file not found in $PATH: unknown

But if I use only one of the commands

bundle exec rails db:create db:migrate db:seed

or only

bundle exec rails s -b 0.0.0.0 -p 3000

it works fine. But I need both of them in my service command.

Do you have any ideas how to write this command in a right way?)

1 Answers1

0

The right answer is to use command this way:

command: ["bash", "-c", "bundle exec rails db:create db:migrate db:seed && bundle exec rails s -b 0.0.0.0 -p 3000"]