skip to Main Content

Trying to setup my environment with sidekiq, already have a redis container up and running.

But sidekiq container gives me this error when I try to get it up.

bundler: command not found: sidekiq Install missing gem executables with 'bundle install'

my docker-compose file:

    sidekiq:
      container_name: app-sidekiq
      build: .
      command: bundle exec sidekiq
      depends_on:
        - redis
      volumes:
        - .:/app
      env_file:
        - .env
      networks:
        - app-network

my .env file has:
REDIS_URL=redis://limpar-api-redis:6380

My app’s Gemfile currently has the sidekiq gem.

When I go into my app container bash and start sidekiq from it, it starts up just fine.

Dockerfile

FROM ruby:2.7.1

ENV LANG C.UTF-8
ENV NODE_VERSION 12
ENV NODE_ENV production
ENV INSTALL_PATH /home/app/app/current

RUN curl -sL https://deb.nodesource.com/setup_$NODE_VERSION.x | bash -
RUN curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add -
RUN echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list

RUN apt-get update -qq
RUN apt-get install -y --no-install-recommends nodejs postgresql-client yarn build-essential vim

RUN mkdir -p $INSTALL_PATH
WORKDIR $INSTALL_PATH

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

COPY . $INSTALL_PATH

RUN rm -rf tmp

RUN useradd -Ms /bin/bash api -u 1001
RUN chown -R api:api /home/app /usr/local/bundle
USER root


EXPOSE 3100
CMD rails server -p 3100 -b 0.0.0.0

Any step missing from my docker files?

2

Answers


  1. Chosen as BEST ANSWER

    Running a docker-compose build --no-cache sidekiq and docker-compose build --no-cache app fixed it for me! It only needed to be rebuilt apparently.


  2. It looks to me that the bundle install step is missing from your Dockerfile. I’d suggest sharing the contents of said file to help debugging.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search