Skip to content

mbuechner/beagen

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Java CI with Maven Docker

Beagen: A Beacon file generator for Deutsche Digitale Bibliothek

A Beacon file generator for Deutsche Digitale Bibliothek. For more information about Beacon files see this draft.

Visit Beagen at DDBlabs: https://labs.ddb.de/app/beagen

See also

Screenshot

Screenshot of Beagen

Docker

Beagen is available as Docker container at GitHub. To run the container execute:

docker run -d -p 8080:8080 -P \
    --env "beagen.baseurl=http://localhost/" \
    --env "beagen.cron=0 0 12 * * ?" \
    --env "beagen.database.dir=files/database/" \
ghcr.io/mbuechner/beagen/beagen:latest

Note: beagen.database.dir should be a directory inside a Docker volume. If not all data will be lost on restart.

Environment variables

Variable Description
beagen.baseurl Base url of Beagen application. Mainly used to build URLs in the Beacon file headers.
beagen.cron How often should the Job run and check for updates at DDB (Quartz documentation).
beagen.database.dir Directory for the database files (Apache Derby)

Container build

If you like to build the Docker container by yourself, please follow these steps. (Not necessary if you use the pre-build container at GitHub.)

  1. Checkout GitHub repository: git clone https://github.com/mbuechner/beagen
  2. Go into folder: cd beagen
  3. Run docker build -t beagen .
  4. Start container:
    docker run -d -p 8080:8080 -P \
        --env "beagen.baseurl=http://localhost/" \
        --env "beagen.cron=0 0 12 * * ?" \
        --env "beagen.database.dir=files/database/" \
    beagen
    
  5. Open browser: http://localhost:8080/

Docker stack

If you're using Docker Stack to deploy application, this could be a possible configuration file in YAML.

version: '2'
services:
  beagen:
    image: ghcr.io/mbuechner/beagen/beagen:latest
    volumes:
      - beagen:/home/beagen/files
    environment:
      - "beagen.baseurl=https://example.com/beagen/"
      - "beagen.cron=0 0 12 * * ?"
      - "beagen.database.dir=/home/beagen/files/database/"
    ports:
      - "8080"
    restart: always
volumes:
  beagen:

Maven

It's a maven project comming with build-in Jetty web server (Javalin). To build this project locally without using Docker, run inside the direcory with pom.xml:

mvn clean package

This will build a fat-jar with all dependencies. To run the webserver type:

java -jar target/beagen.jar

It'll run locally under: http://localhost:8080/