Skip to content

Commit

Permalink
feat(solr): add Solr container run configuration #7662
Browse files Browse the repository at this point in the history
  • Loading branch information
poikilotherm committed Mar 11, 2022
1 parent f3d3643 commit a8c783b
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 0 deletions.
1 change: 1 addition & 0 deletions modules/dataverse-parent/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,7 @@
<!-- Container related -->
<fabric8-dmp.version>0.39.1</fabric8-dmp.version>
<ct.registry>ghcr.io</ct.registry>
<solr.collection>collection1</solr.collection>
<solr.configset>dataverse</solr.configset> <!-- Note: container usage only for now, might be reused in code -->
</properties>

Expand Down
32 changes: 32 additions & 0 deletions modules/solr-configset/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,7 @@
<properties>
<solr.packaging.type>docker</solr.packaging.type>
<solr.configsets.path>/opt/solr/server/solr/configsets</solr.configsets.path>
<solr.memory>1073741824</solr.memory> <!-- = 1 GiB in bytes -->
</properties>
<build>
<plugins>
Expand All @@ -193,6 +194,7 @@
<artifactId>docker-maven-plugin</artifactId>
<extensions>true</extensions>
<configuration>
<startParallel>true</startParallel>
<images>
<image>
<alias>solr</alias>
Expand Down Expand Up @@ -227,8 +229,38 @@
<descriptor>${project.basedir}/src/assembly/default.xml</descriptor>
</assembly>
</build>
<!-- Run via Maven: mvn -Pct package docker:run -->
<run>
<cmd>
<shell>solr-precreate ${solr.collection} ${solr.configsets.path}/${solr.configset}</shell>
</cmd>
<!-- Limit to 1 GiB memory by default, but allow overrides via property -->
<memory>${solr.memory}</memory>
<ports>
<port>8939:8939</port>
</ports>
<volumes>
<bind>
<volume>solr-temp-volume:/var/solr</volume>
</bind>
</volumes>
</run>
</image>
</images>
<volumes>
<volume>
<name>solr-temp-volume</name>
<driver>local</driver>
<opts>
<type>tmpfs</type>
<device>tmpfs</device>
<o>size=256m,uid=8939</o>
</opts>
<labels>
<volatileData>true</volatileData>
</labels>
</volume>
</volumes>
</configuration>
</plugin>
</plugins>
Expand Down

0 comments on commit a8c783b

Please sign in to comment.