From b9c43a58b98134acafc8118b81062332d509044c Mon Sep 17 00:00:00 2001 From: Ronald Sacher Date: Tue, 16 Sep 2025 14:13:19 +0200 Subject: [PATCH] add docker compose to simplify running tests --- Dockerfile | 7 +++++++ README.md | 13 +++++++++++++ docker-compose.yml | 13 +++++++++++++ 3 files changed, 33 insertions(+) create mode 100644 Dockerfile create mode 100644 docker-compose.yml diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..01a9a54 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,7 @@ +FROM ruby:3.4 + +WORKDIR /usr/src/app + +ARG DEBIAN_FRONTEND=noninteractive + +RUN apt update && apt install -y default-jre \ No newline at end of file diff --git a/README.md b/README.md index cf2b436..b7e7ce2 100644 --- a/README.md +++ b/README.md @@ -9,6 +9,19 @@ See tests for examples. 1. The library, for ZUGFeRD 2.x, currently only supports the EN16931 variant. This is probably what you want as well. PRs welcome. 3. This does not contain any code to attach the XML to a PDF file, mainly because I have yet to find a ruby library to do that. For software that does this, take a look at [this python library](https://github.com/akretion/factur-x) or [this Java library which also does extended validation](https://mustangproject.org) +## Gem development & test +### With docker compose installed +```shell +docker compose up +``` +### Without docker compose installed +* install ruby +* install jre +* bundle install +```shell +bundle exec rake +``` + ## Contributors See [CONTRIBUTORS.md](CONTRIBUTORS.md). diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..9183e99 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,13 @@ +volumes: + bundle: + +services: + app: + build: + context: . + command: bash -c 'bundle && bundle exec rake' + volumes: + - .:/usr/src/app + - "bundle:/bundle" + environment: + BUNDLE_PATH: /bundle \ No newline at end of file