在Elastic Beanstalk Local上运行时,Docker无法找到Gemfile或.bundle /目录

时间:2018-09-04 21:43:23

标签: amazon-web-services docker ruby-on-rails-5 elastic-beanstalk gemfile

我正在尝试在多容器弹性beantalk环境中部署docker映像。当我使用function ticktock(){ var start = new Date().valueOf(); setInterval(function(){ var now = new Date().valueOf(); var elapsed = (now - start) / 1000; var seconds = elapsed % 60; var minutes = (elapsed / 60) % (60); var hours = (elapsed / (60 * 60)) % (60); $("#seconds").html(seconds); $("#minutes").html(minutes); $("#hours").html(hours); }, 1000); } docker-compose build在本地运行该应用程序时,该应用程序正常运行。但是,当我尝试使用docker-compose up运行Dockerrun.aws.json文件时,出现错误消息:

eb local run

我的Elastic beantalk文件夹仅包含Dockerrun.aws.json文件。它可以正确获取数据库映像,但是在加载应用程序时失败。 编辑:我gitignoring我的捆绑器文件 供参考,这些是我的文件:

  

docker-compose.yml

 Could not locate Gemfile or .bundle/ directory
 elasticbeanstalk_app_1 exited with code 10
  

Dockerfile

version: '3.2'
volumes: 
  postgres-data:
services:
  db:
    image: postgres
    volumes: 
      - postgres-data:/var/lib/postgresql/data
  webpacker:
    build: .
    env_file: 
      - '.env.docker'
    command: npm build
    volumes:
      - .:/project
    ports: 
      - '3035:3035'
  app:
    build:
      context: .
      dockerfile: Dockerfile
    command: bundle exec rails s -p 3000 -b '0.0.0.0'
    volumes:
      - .:/project
    ports:
      - "3000:3000"
    depends_on:
      - db
  

Dockerrun.aws.json

FROM starefossen/ruby-node:2-8-stretch

RUN apt-get update -qq && \
    apt-get install -y nano build-essential libpq-dev && \
    gem install bundler

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

RUN apt-get install -y nodejs
RUN apt-get update && apt-get install -y yarn

RUN mkdir /project
COPY Gemfile Gemfile.lock /project/
WORKDIR /project
RUN bundle install

COPY . /project

0 个答案:

没有答案