正在尝试使用sidekiq设置我的环境,已经有了一个redis容器并在运行。
但是,当我尝试启动sidekiq容器时,它给了我这个错误。
bundler: command not found: sidekiq Install missing gem executables with 'bundle install'
我的docker-compose文件:
sidekiq:
container_name: app-sidekiq
build: .
command: bundle exec sidekiq
depends_on:
- redis
volumes:
- .:/app
env_file:
- .env
networks:
- app-network我的.env文件包含:REDIS_URL=redis://limpar-api-redis:6380
我的应用程序的Gemfile目前有sidekiq gem。
当我进入我的应用程序容器bash并从其中启动sidekiq时,它启动得很好。
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我的docker文件中有遗漏的步骤吗?
发布于 2021-05-04 00:29:06
在我看来,您的Dockerfile中缺少bundle install步骤。我建议共享上述文件的内容,以帮助调试。
发布于 2021-05-04 05:40:11
运行docker-compose build --no-cache sidekiq和docker-compose build --no-cache app为我解决了这个问题!显然,它只需要重建。
https://stackoverflow.com/questions/67372450
复制相似问题