Skip to content

Commit 562aa9f

Browse files
committed
changed Dockerfile for airflow, fuseki and digest-api. added requirements and library version change
1 parent a857375 commit 562aa9f

5 files changed

Lines changed: 50 additions & 36 deletions

File tree

infra/airflow-cluster/Dockerfile

Lines changed: 10 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,15 @@ FROM docker.io/apache/airflow:2.5.1-python3.8
22

33
# quick sudo
44
USER root
5-
RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys A8D3785C
6-
RUN apt-get update && apt-get install make && apt-get install build-essential git -y && apt-get install -y wget && apt-get install -y unzip
7-
RUN apt install -y default-jre
5+
6+
RUN apt-get update && apt-get install -y \
7+
build-essential=12.9 \
8+
default-jre=2:1.11-72 \
9+
git=1:2.30.2-1+deb11u2 \
10+
make=4.3-4.1 \
11+
wget=1.21-1+deb11u1 \
12+
unzip=6.0-26+deb11u1 \
13+
&& rm -rf /var/lib/apt/lists/*
814

915
# back to normal user
1016
USER airflow
@@ -14,20 +20,7 @@ COPY requirements.txt /opt/airflow
1420

1521
# working in the /opt/airflow
1622
WORKDIR /opt/airflow
17-
RUN mkdir -p ./.rmlmapper ./dags ./ted_sws
18-
19-
COPY ted_sws /opt/airflow/ted_sws
20-
21-
COPY dags /opt/airflow/dags
22-
23-
RUN wget -c https://github.com/RMLio/rmlmapper-java/releases/download/v6.2.2/rmlmapper-6.2.2-r371-all.jar -O ./.rmlmapper/rmlmapper.jar
24-
25-
26-
RUN wget -c https://github.com/Saxonica/Saxon-HE/releases/download/SaxonHE10-9/SaxonHE10-9J.zip -P .saxon/
27-
RUN cd .saxon && unzip SaxonHE10-9J.zip && rm -rf SaxonHE10-9J.zip
28-
29-
RUN mkdir -p ./.limes
30-
RUN wget -c https://github.com/dice-group/LIMES/releases/download/1.7.9/limes.jar -P ./.limes
23+
RUN mkdir -p ./dags ./ted_sws
3124

3225

3326
RUN pip install --upgrade pip

infra/airflow/Dockerfile

Lines changed: 10 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,15 @@ FROM docker.io/apache/airflow:2.5.1-python3.8
22

33
# quick sudo
44
USER root
5-
RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys A8D3785C
6-
RUN apt-get update && apt-get install make && apt-get install build-essential git -y && apt-get install -y wget && apt-get install -y unzip
7-
RUN apt install -y default-jre
5+
6+
RUN apt-get update && apt-get install -y \
7+
build-essential=12.9 \
8+
default-jre=2:1.11-72 \
9+
git=1:2.30.2-1+deb11u2 \
10+
make=4.3-4.1 \
11+
wget=1.21-1+deb11u1 \
12+
unzip=6.0-26+deb11u1 \
13+
&& rm -rf /var/lib/apt/lists/*
814

915
# back to normal user
1016
USER airflow
@@ -14,20 +20,7 @@ COPY requirements.txt /opt/airflow
1420

1521
# working in the /opt/airflow
1622
WORKDIR /opt/airflow
17-
RUN mkdir -p ./.rmlmapper ./dags ./ted_sws
18-
19-
COPY ted_sws /opt/airflow/ted_sws
20-
21-
COPY dags /opt/airflow/dags
22-
23-
RUN wget -c https://github.com/RMLio/rmlmapper-java/releases/download/v6.2.2/rmlmapper-6.2.2-r371-all.jar -O ./.rmlmapper/rmlmapper.jar
24-
25-
26-
RUN wget -c https://github.com/Saxonica/Saxon-HE/releases/download/SaxonHE10-9/SaxonHE10-9J.zip -P .saxon/
27-
RUN cd .saxon && unzip SaxonHE10-9J.zip && rm -rf SaxonHE10-9J.zip
28-
29-
RUN mkdir -p ./.limes
30-
RUN wget -c https://github.com/dice-group/LIMES/releases/download/1.7.9/limes.jar -P ./.limes
23+
RUN mkdir -p ./dags ./ted_sws
3124

3225

3326
RUN pip install --upgrade pip

infra/digest_api/Dockerfile

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,13 @@ RUN pip install --upgrade pip
99
RUN pip install -r digest_service/requirements.txt
1010
RUN pip install -r digest_service/project_requirements.txt
1111

12+
# Create a non-root user and group
13+
RUN groupadd -r appuser && useradd -r -g appuser appuser
14+
15+
# Set the appropriate permissions for the directories and files
16+
RUN chown -R appuser:appuser /usr/src/api/id_manager
17+
18+
# Switch to the non-root user
19+
USER appuser
20+
1221
ENTRYPOINT uvicorn --host 0.0.0.0 --port 8000 ted_sws.notice_transformer.entrypoints.api.digest_service.main:app

infra/fuseki/Dockerfile

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,22 @@ FROM docker.io/secoresearch/fuseki:4.5.0
22

33
USER root
44
RUN apt-get update; \
5-
apt-get install -y --no-install-recommends procps
5+
apt-get install -y --no-install-recommends procps
6+
7+
8+
# Create a non-root user and group
9+
RUN groupadd -r fuseki && useradd -r -g fuseki fuseki
10+
11+
# Ensure the /fuseki-base and /fuseki-data directories exist and set permissions
12+
RUN mkdir -p /fuseki-base /fuseki-data/databases /tmp && \
13+
chown -R fuseki:fuseki /fuseki-base /fuseki-data /tmp
14+
15+
# Switch to the non-root user
16+
USER fuseki
17+
18+
19+
20+
21+
22+
23+

requirements.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ pydantic~=1.9.0
33
requests~=2.28.2
44
deepdiff~=5.7.0
55
jinja2~=3.1.2
6-
python-dotenv~=0.19.2
6+
python-dotenv~=0.21.0
77
pymongo~=4.0.1
88
apache-airflow~=2.5.1
99
hvac==0.11.2
@@ -27,3 +27,4 @@ certifi~=2022.12.7
2727
shortuuid~=1.0.11
2828
pendulum~=2.1.2
2929
saxonche~=12.4
30+
elasticsearch-dbapi==0.2.11

0 commit comments

Comments
 (0)