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

feat: add Dockerfile template #400

Merged
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
14 changes: 14 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: "Test"

on:
push:

jobs:
build-docker-image:
name: Build Docker image
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Build SolrWayback Docker image
run: docker build --tag solrwayback .
61 changes: 61 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# This dockerfile sets up the SolrWayback bundle and attempts to run both Solr and Tomcat.
# To build the image, run:
# docker build . --tag solrwayback

# To run SolrWayback, you need to launch it with the following parameters
# docker run --publish 8080:8080 --publish 8983:8983 --volume <path/to/WARCs>:/host_dir --tty --interactive solrwayback bash
# where <path/to/WARCs> is a file path that only contains WARC files and directories.

# When the container is running, run the following commands to start Solr and Tomcat:
# export SOLRWAYBACK_VERSION=4.4.2
# export APACHE_TOMCAT_VERSION=8.5.60
# export SOLR_VERSION=7.7.3
# ./unpacked-bundle/solrwayback_package_$SOLRWAYBACK_VERSION/solr-$SOLR_VERSION/bin/solr start
# ./unpacked-bundle/solrwayback_package_$SOLRWAYBACK_VERSION/apache-tomcat-$APACHE_TOMCAT_VERSION/bin/startup.sh

# You should now verify that the following links works with a browser:
# http://localhost:8080/solrwayback/
# http://localhost:8983/solr/#/

# If you have some WARC files you want to index, you can index them with the following commands:
# WARC_FILES=$(find /host_dir/ -type f)
# ./unpacked-bundle/solrwayback_package_$SOLRWAYBACK_VERSION/indexing/warc-indexer.sh $WARC_FILES

FROM ubuntu:22.04

ENV SOLRWAYBACK_VERSION 4.4.2
ENV APACHE_TOMCAT_VERSION 8.5.60
ENV SOLR_VERSION 7.7.3

RUN apt-get update --assume-yes --quiet
RUN apt-get install wget unzip --assume-yes --quiet

# Install dependencies
RUN apt-get install default-jre lsof curl --assume-yes --quiet

RUN useradd --create-home --shell /bin/bash builder
RUN chown builder:builder /home/builder -R

USER builder
WORKDIR /home/builder

# Download and unpack SolrWayback bundle
RUN mkdir --parents solrwayback-zip
RUN wget --quiet https://github.com/netarchivesuite/solrwayback/releases/download/${SOLRWAYBACK_VERSION}/solrwayback_package_${SOLRWAYBACK_VERSION}.zip \
--output-document solrwayback-zip/bundle.zip

RUN mkdir unpacked-bundle
RUN unzip -q solrwayback-zip/bundle.zip -d unpacked-bundle
RUN rm --recursive solrwayback-zip

# Set up SolrWayback configuration
RUN cp unpacked-bundle/solrwayback_package_${SOLRWAYBACK_VERSION}/properties/solrwayback.properties .
RUN cp unpacked-bundle/solrwayback_package_${SOLRWAYBACK_VERSION}/properties/solrwaybackweb.properties .

# Verify that apache-tomcat works
RUN unpacked-bundle/solrwayback_package_${SOLRWAYBACK_VERSION}/apache-tomcat-${APACHE_TOMCAT_VERSION}/bin/startup.sh
RUN unpacked-bundle/solrwayback_package_${SOLRWAYBACK_VERSION}/apache-tomcat-${APACHE_TOMCAT_VERSION}/bin/shutdown.sh

# Verify that solr works
RUN unpacked-bundle/solrwayback_package_${SOLRWAYBACK_VERSION}/solr-${SOLR_VERSION}/bin/solr start
RUN unpacked-bundle/solrwayback_package_${SOLRWAYBACK_VERSION}/solr-${SOLR_VERSION}/bin/solr stop -all
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,8 @@ Documents in SolrWayback are indexed through the [warc-indexer](https://github.c


## Build and test with Docker
Currently disabled as docker image has not been maintained.

A containerized sample can be found [here](./Dockerfile)

## Contact
Thomas Egense ([email protected])
Expand Down
Loading