-
Notifications
You must be signed in to change notification settings - Fork 297
How to build and run in Docker
This document describes the process of building the OpenWayback from source and running, all in the Docker environment. This can be very handy for development and testing in different environments. Generated Docker image is kept minimal which makes it suitable for running in production as well.
Docker (version 17.05 or later is required for building the image).
Acquire the source code.
$ git clone https://github.com/iipc/openwayback.git
$ cd openwayback
Make any changes to the source code if needed. Then build the docker image.
$ docker image build -t openwayback .
This will download dependencies, compile the code, run tests, package, and place necessary components in appropriate places to build a minimal Docker image with the name openwayback.
This process may take a while (depending on the network bandwidth and processor speed).
The default configuration of the OpenWayback uses the automatic BDB Indexer and expects WARC files at ${WAYBACK_BASEDIR}/files1/ or ${WAYBACK_BASEDIR}/files2/.
By default the WAYBACK_BASEDIR is set to /data volume in the Docker image.
Create necessary directory structure on the host machine for testing and populate it with some test files.
$ mkdir -p /tmp/owb/files1
$ cp /path/to/sample/*.warc /tmp/owb/files1/
Run a Docker container with appropriately mounted volumes and port mapping. By default the container would run the Tomcat server.
$ docker container run -it --rm -v /tmp/owb:/data -p 8080:8080 openwayback
Once the WARC files are indexed, they should be ready for lookup at http://localhost:8080/.
Copyright © 2005-2022 [tonazol](http://netpreserve.org/). CC-BY. https://github.com/iipc/openwayback.wiki.git