diff --git a/README.md b/README.md index 7db80e4..ae74d16 100644 --- a/README.md +++ b/README.md @@ -1,24 +1,11 @@ -# README +# boxwalker -This README would normally document whatever steps are necessary to get the -application up and running. +## Installation and usage -Things you may want to cover: +### Docker -* Ruby version - -* System dependencies - -* Configuration - -* Database creation - -* Database initialization - -* How to run the test suite - -* Services (job queues, cache servers, search engines, etc.) - -* Deployment instructions - -* ... +```shell +docker compose build +docker compose up +/bin/bash ./solr/dev-init.sh +``` diff --git a/compose.yml b/compose.yml index baf2ae1..e2b12f4 100644 --- a/compose.yml +++ b/compose.yml @@ -1,19 +1,50 @@ --- services: + app: + depends_on: + solr: + condition: service_healthy + build: + context: . + ports: + - '3000:3000' + environment: + - SOLR_URL=http://solr:8983/solr/blacklight-collection + env_file: + - .env solr: + depends_on: + zookeeper: + condition: service_healthy image: solr:9.7 volumes: - solr-data:/var/solr - $PWD/solr/conf:/opt/solr/conf + healthcheck: + interval: 30s + timeout: 10s + start_period: 30s + retries: 5 + test: ["CMD-SHELL", "curl -s -f 'http://localhost:8983/solr/admin/collections?action=CLUSTERSTATUS'"] ports: - - 8983:8983 - entrypoint: - - docker-entrypoint.sh - - solr-precreate - - blacklight-core - - /opt/solr/conf + - '8983:8983' + command: solr-foreground environment: - SOLR_JAVA_MEM=-Xms1024m -Xmx1024m - SOLR_HEAP=1024m + - ZK_HOST=zookeeper:2181 + zookeeper: + image: zookeeper + healthcheck: + interval: 30s + timeout: 10s + start_period: 30s + retries: 5 + test: [ "CMD", "nc", "-z", "-w", "2", "localhost", "2181" ] # Check if ZooKeeper is listening on port 2181 + ports: + - '2181:2181' + environment: + ZOO_MY_ID: 1 + ZOO_SERVERS: server.1=0.0.0.0:2888:3888;2181 volumes: solr-data: diff --git a/solr/dev-init.sh b/solr/dev-init.sh new file mode 100644 index 0000000..dd0a105 --- /dev/null +++ b/solr/dev-init.sh @@ -0,0 +1,3 @@ +#!/bin/bash + +docker compose exec solr solr create -c blacklight-collection -d /opt/solr/conf