diff --git a/Dockerfile b/Dockerfile index 195d22d..63d2b0b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -8,14 +8,16 @@ RUN apt-get update -yqq && apt-get install -yqq --no-install-recommends \ raptor2-utils \ && rm -rf /var/lib/apt/lists/* -# The Gemfile Caching Trick RUN mkdir -p /srv/ontoportal/ncbo_ontology_recommender -COPY *.gemspec Gemfile* /srv/ontoportal/ncbo_ontology_recommender/ +RUN mkdir -p /srv/ontoportal/bundle +COPY Gemfile* *.gemspec /srv/ontoportal/ncbo_ontology_recommender/ WORKDIR /srv/ontoportal/ncbo_ontology_recommender +RUN gem update --system RUN gem install bundler -ENV BUNDLE_PATH /bundle +ENV BUNDLE_PATH=/srv/ontoportal/bundle RUN bundle install + COPY . /srv/ontoportal/ncbo_ontology_recommender CMD ["/bin/bash"] diff --git a/Gemfile b/Gemfile index f62ffbd..20e4d61 100644 --- a/Gemfile +++ b/Gemfile @@ -1,7 +1,7 @@ source 'https://rubygems.org' gem 'cube-ruby' -gem 'faraday', '~> 2.0' +gem 'faraday' gem 'ffi' gem 'oj', '~> 3.0' gem 'rake', '~> 10.0' diff --git a/Gemfile.lock b/Gemfile.lock index 5eefbab..0f3235e 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -173,7 +173,7 @@ PLATFORMS DEPENDENCIES cube-ruby - faraday (~> 2.0) + faraday ffi goo! minitest (~> 4.0) diff --git a/dip.yml b/dip.yml new file mode 100644 index 0000000..92d63ce --- /dev/null +++ b/dip.yml @@ -0,0 +1,55 @@ +version: '7.1' + +# Define default environment variables to pass +# to Docker Compose +#environment: +# RAILS_ENV: development + +compose: + files: + - docker-compose.yml + +interaction: + # This command spins up a ontologies_api container with the required dependencies (solr, 4store, etc), + # and opens a terminal within it. + runner: + description: Open a Bash shell within a ontologies_api container (with dependencies up) + service: ruby + command: /bin/bash + + # Run a Rails container without any dependent services (useful for non-Rails scripts) + bash: + description: Run an arbitrary script within a container (or open a shell without deps) + service: ruby + command: /bin/bash + compose_run_options: [ no-deps ] + + # A shortcut to run Bundler commands + bundle: + description: Run Bundler commands + service: ruby + command: bundle + compose_run_options: [ no-deps ] + + # A shortcut to run unit tests + test: + description: Run minitest unit tests + service: ruby + command: bundle exec rake test + + test-ag: + description: Run minitest unit tests + service: ruby-ag + command: bundle exec rake test + + + 'redis-cli': + description: Run Redis console + service: redis-ut + command: redis-cli -h redis-ut + +#provision: + #- dip compose down --volumes + #- dip compose up -d solr 4store + #- dip bundle install + #- dip bash -c bin/setup diff --git a/docker-compose.yml b/docker-compose.yml index 2960866..d7d7d8f 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -5,7 +5,7 @@ services: build: context: . args: - RUBY_VERSION: '2.7' + RUBY_VERSION: '3.0' volumes: - bundle:/bundle - .:/srv/ontoportal/ncbo_ontology_recommender @@ -27,7 +27,7 @@ services: command: "bundle exec rake test TESTOPTS='-v'" solr-ut: - image: ontoportal/solr-ut:0.0.2 + image: ontoportal/solr-ut:0.1.0 redis-ut: image: redis