-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
65 lines (51 loc) · 1.89 KB
/
Dockerfile
File metadata and controls
65 lines (51 loc) · 1.89 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
# ==========================
# Stage 1: Build KG (all.ttl)
# ==========================
# Use Python 3.11 base
FROM python:3.11-slim AS widoco
RUN set -eux; \
apt-get update; \
apt-get install -y --no-install-recommends \
ca-certificates \
openjdk-17-jdk-headless \
curl wget git unzip dos2unix \
|| { apt-get update; apt-get install -y --no-install-recommends default-jre-headless curl wget git unzip dos2unix; }; \
rm -rf /var/lib/apt/lists/*
ENV ROBOT_JAVA_ARGS="-Xmx8G -Dfile.encoding=UTF-8"
WORKDIR /app
# Install Python deps (cached layer)
COPY requirements.txt /app/requirements.txt
RUN python -m pip install --no-cache-dir -r /app/requirements.txt
# Robot + Widoco
RUN wget -q https://github.com/ontodev/robot/releases/download/v1.9.8/robot.jar -O /usr/local/bin/robot.jar \
&& printf '#!/bin/sh\nexec java $ROBOT_JAVA_ARGS -jar /usr/local/bin/robot.jar "$@"\n' > /usr/local/bin/robot \
&& chmod +x /usr/local/bin/robot \
&& wget -q https://github.com/dgarijo/Widoco/releases/download/v1.4.25/widoco-1.4.25-jar-with-dependencies_JDK-11.jar
# App sources
COPY . /app
RUN chmod +x /app/download_components.sh /app/reason_validate.sh \
&& ./download_components.sh \
&& ./reason_validate.sh \
&& test -s data/all.ttl
# Copy a predictable artifact
RUN mkdir -p /data && cp data/all.ttl /data/ontology.ttl
# Generate docs
RUN java -jar widoco-1.4.25-jar-with-dependencies_JDK-11.jar \
-ontFile data/all.ttl \
-outFolder docs \
-uniteSections \
-includeAnnotationProperties \
-lang en-de \
-getOntologyMetadata \
-noPlaceHolderText \
-rewriteAll \
-webVowl
# ==========================
# Stage 2: Run Shmarql
# ==========================
FROM ghcr.io/epoz/shmarql:v0.56
COPY --from=widoco /app/data /data
COPY --from=widoco /app/docs /src/docs
COPY mkdocs.yml a.yml
RUN python -m shmarql docs_build -f a.yml
RUN mkdir /src/site/ontology