Quantcast
Channel: Active questions tagged redis+ruby-on-rails - Stack Overflow
Viewing all articles
Browse latest Browse all 873

docker-compose can't find gemfile in bundle

$
0
0

I have been trying to get this app working for a while. It doesn't give me any errors to build it and it works on when my teammates follow the same steps. But, when I run

docker-compose run app bundle exec rake db:setup

I get

Starting joatu-db           ... done
Starting joatu-v2_bundler_1 ... done
/joatu/Gemfile not found

I have tried to bundle it using:

docker-compose run app bundle install

and I get

Starting joatu-v2_bundler_1 ... done 
Starting joatu-db           ... done

[!] There was an error parsing `Gemfile`: No such file or directory @ rb_sysopen - /joatu/Gemfile. Bundler cannot continue.

I am running Windows 10 version 1809

and I am running it on WSL: Ubuntu 18.04

Docker version: docker engine 18.09

docker compose version: 1.24.0 rc-1

The docker file is:

FROM ruby:2.4.5

MAINTAINER Robert JJ Smith <rsmithlal@gmail.com>

RUN apt-get update -qq && apt-get install -y build-essential libpq-dev nodejs libssl-dev

RUN mkdir /joatu
WORKDIR /joatu
COPY Gemfile /joatu/Gemfile
COPY Gemfile.lock /joatu/Gemfile.lock

# Use a persistent volume for the gems installed by the bundler
ENV BUNDLE_GEMFILE=/joatu/Gemfile \
  BUNDLE_JOBS=2 \
  BUNDLE_PATH=/bundler \
  GEM_PATH=/bundler \
  GEM_HOME=/bundler

#RUN gem install bundler #tried with it and without it same error
RUN bundle install

COPY . /joatu

docker-compose.yml

version: '2.1'

volumes:
  db-data:

services:
  app:
    container_name: joatu-app
    build: .
    command: bundle exec rails s -p 3000 -b '0.0.0.0'
    volumes:
      - $PWD:/joatu
    volumes_from:
      - bundler
    ports:
      - "3000:3000"
    depends_on:
      - db
    links:
      - db
    env_file:
      - './docker/.env.app.conf'
  db:
    container_name: joatu-db
    volumes:
      - db-data:/var/lib/postgresql/data
    image: mdillon/postgis:latest
    ports:
      - 5432:5432
    env_file:
      - './docker/.env.app.conf'
  bundler:
    image: busybox
    volumes:
      - /bundler

I have changed . to $PWD and back again to try and 'unmask it' and it still didn't work.

I have moved in different folders in windows to see if it was a permission issue. It still didn't work. And, I have deleted the image and rebuild it to make sure the old image wasn't messing with the changes.

Any help would be appreciated.

Original file app is located at https://github.com/joatuapp/joatu-v2

edit:

I ran the command

 docker-compose run app ls-la 

and its shown that the folder is empty. So, now I know it's a copying issue but I still don't know how to fix it.


Viewing all articles
Browse latest Browse all 873

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>