Unable to provide config files to puma in kubernetes using command/args section of kubernets Deployment yam file

  docker, kubernetes, ruby-on-rails, sinatra

What could be the reason of Deployment not being able to see config files?

This is a part from Deployment

command: ["bundle", "exec", "puma", "-C", "config/puma.rb"]

already tried with ./config/.. and using args instead of command

I’m getting Errno::ENOENT: No such file or directory @ rb_sysopen - config/puma.rb

Everything used to work fine with docker-compose

When I keep the last line (CMD) from the Dockerfile below and omit the command: in Deployment, everything works fine but, to reuse the image for sidekiq, I need to provide config files.

Dockerfile

FROM ruby:2.7.2

RUN apt-get update -qq && apt-get install -y build-essential ca-certificates libpq-dev nodejs postgresql-client yarn vim -y

ENV APP_ROOT /var/www/app

RUN mkdir -p $APP_ROOT

WORKDIR $APP_ROOT

COPY Gemfile Gemfile
COPY Gemfile.lock Gemfile.lock
COPY public public/
RUN gem install bundler
RUN bundle install

# tried this
COPY config config/ 

COPY . .

EXPOSE 9292

# used to have this line but I want to reuse the image
# CMD ["bundle", "exec", "puma", "-C", "config/puma.rb"]

Source: Docker Questions

LEAVE A COMMENT