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

Add an official Dockerfile #151

Open
sarimak opened this issue Feb 18, 2025 · 0 comments
Open

Add an official Dockerfile #151

sarimak opened this issue Feb 18, 2025 · 0 comments

Comments

@sarimak
Copy link

sarimak commented Feb 18, 2025

Hi, running the validator in a Docker container currently requires manual creation of the Dockerfile. It would be nice to have an official one, so the validator web service runs as intended by the official authority.

I prepared a Dockerfile on my own, feel free to reuse it as you find it useful:

FROM docker.io/eclipse-temurin:21-jre-alpine

ARG VALIDATOR_VERSION=1.5.0
ARG XRECHNUNG_VERSION=3.0.2
ARG XRECHNUNG_DATE=2024-10-31

WORKDIR /app

RUN apk add --no-cache wget unzip \
    && wget -O validator.zip https://github.com/itplr-kosit/validator/releases/download/v${VALIDATOR_VERSION}/validator-${VALIDATOR_VERSION}-distribution.zip \
    && wget -O xrechnung-config.zip https://github.com/itplr-kosit/validator-configuration-xrechnung/releases/download/release-${XRECHNUNG_DATE}/validator-configuration-xrechnung_${XRECHNUNG_VERSION}_${XRECHNUNG_DATE}.zip \
    && unzip validator.zip validationtool-${VALIDATOR_VERSION}-standalone.jar \
    && mv validationtool-${VALIDATOR_VERSION}-standalone.jar validationtool.jar \
    && mkdir -p scenarios \
    && unzip xrechnung-config.zip -d /app/scenarios \
    && rm -rf validator.zip xrechnung-config.zip \
    && apk del wget unzip

# Enable the debug GUI only when the ENABLE_GUI environment variable is set to "true"
RUN echo '#!/bin/sh' > /app/entrypoint.sh && \
    echo 'COMMAND="java -jar validationtool.jar -r /app/scenarios -s /app/scenarios/scenarios.xml -D -H 0.0.0.0 -P 8080"' >> /app/entrypoint.sh && \
    echo 'if [ "${ENABLE_GUI:-}" != "true" ]; then' >> /app/entrypoint.sh && \
    echo '    COMMAND="${COMMAND} --disable-gui"' >> /app/entrypoint.sh && \
    echo 'fi' >> /app/entrypoint.sh && \
    echo 'exec ${COMMAND}' >> /app/entrypoint.sh

RUN chmod +x /app/entrypoint.sh

EXPOSE 8080

ENTRYPOINT ["/app/entrypoint.sh"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant