Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix spinning up BL instance using docker-compose up #2559

Merged
merged 1 commit into from
Nov 29, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .docker/app/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,10 @@ RUN apk add --update --no-cache \
libxml2-dev \
libxslt-dev \
nodejs \
shared-mime-info \
sqlite-dev \
tzdata
tzdata \
yarn

RUN mkdir /app
WORKDIR /app
Expand Down
3 changes: 3 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Gemfile.lock
.internal_test_app
.solr_wrapper.yml
4 changes: 2 additions & 2 deletions .env
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
ALPINE_RUBY_VERSION=2.6.5
RAILS_VERSION=5.2.5
ALPINE_RUBY_VERSION=3.0.3
RAILS_VERSION=6.0.3.4
SOLR_PORT=8983
SOLR_URL=http://solr:8983/solr/blacklight-core
SOLR_VERSION=latest
7 changes: 5 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,18 @@ services:
dockerfile: .docker/app/Dockerfile
args:
- ALPINE_RUBY_VERSION
volumes:
- .:/app
# mounting . is causing seg-fault on macosx
#volumes:
#- .:/app
depends_on:
- solr
ports:
- "3000:3000"
environment:
- SOLR_URL # Set via environment variable or use default defined in .env file
- RAILS_VERSION # Set via environment variable or use default defined in .env file
- SOLR_ENV=docker-compose
- ENGINE_CART_RAILS_OPTIONS=--skip-git --skip-listen --skip-spring --skip-keeps --skip-action-cable --skip-coffee --skip-test --skip-solr

solr:
environment:
Expand Down
6 changes: 5 additions & 1 deletion tasks/blacklight.rake
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,11 @@ def system_with_error_handling(*args)
end

def with_solr(&block)
if system('docker-compose -v')
# We're being invoked by the app entrypoint script and solr is already up via docker-compose
if ENV['SOLR_ENV'] == 'docker-compose'
yield
elsif system('docker-compose -v')
# We're not running docker-compose up but still want to use a docker instance of solr.
begin
puts "Starting Solr"
system_with_error_handling "docker-compose up -d solr"
Expand Down