This repository has been archived by the owner on Jul 30, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
103 lines (74 loc) · 3.69 KB
/
Dockerfile
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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
FROM java:8-jre-alpine
MAINTAINER Jouni Tuominen <jouni.tuominen@aalto.fi>
RUN apk add --update pwgen bash curl wget ca-certificates findutils coreutils ruby && rm -rf /var/cache/apk/*
# Update below according to https://jena.apache.org/download/
ENV FUSEKI_SHA512 2d5c4e245d0d03bc994248dd43f718b8467d5b81204e2894abba86ec20b66939c84134580618d91d9b15bd90d90b090ab4bc691ae8778eb060d06df117dda8bb
ENV FUSEKI_VERSION 3.10.0
ENV JENA_SHA512 7dafe7aa28cb85a6da9f6f2b109372ec0d097d4f07d8cb5882dde814b55cdb60512ab9bc09c2593118aaf3fbbc1f65f1d3b921faca7bddefd3f6bf9d7f332998
ENV JENA_VERSION 3.10.0
ENV MIRROR http://www.eu.apache.org/dist/
ENV ARCHIVE http://archive.apache.org/dist/
# Config and data
ENV FUSEKI_BASE /fuseki-base
# Fuseki installation
ENV FUSEKI_HOME /jena-fuseki
ENV PORT 3030
ENV JENA_HOME /jena
ENV JENA_BIN $JENA_HOME/bin
WORKDIR /tmp
# sha512 checksum
RUN echo "$FUSEKI_SHA512 fuseki.tar.gz" > fuseki.tar.gz.sha512
# Download/check/unpack/move Fuseki in one go (to reduce image size)
RUN wget -O fuseki.tar.gz $MIRROR/jena/binaries/apache-jena-fuseki-$FUSEKI_VERSION.tar.gz || \
wget -O fuseki.tar.gz $ARCHIVE/jena/binaries/apache-jena-fuseki-$FUSEKI_VERSION.tar.gz && \
sha512sum -c fuseki.tar.gz.sha512 && \
tar zxf fuseki.tar.gz && \
mv apache-jena-fuseki* $FUSEKI_HOME && \
rm fuseki.tar.gz* && \
cd $FUSEKI_HOME && rm -rf fuseki.war
# As "localhost" is often inaccessible within Docker container,
# we'll enable basic-auth with a random admin password
# (which we'll generate on start-up)
COPY shiro.ini /jena-fuseki/shiro.ini
COPY docker-entrypoint.sh /
RUN chmod 755 /docker-entrypoint.sh
# SeCo extensions
COPY spatial-arq-1.0.0-SNAPSHOT-with-dependencies.jar /javalibs/
# Fuseki config
#ENV ASSEMBLER $FUSEKI_BASE/configuration/assembler.ttl
#COPY assembler.ttl $ASSEMBLER
#COPY fuseki-config.ttl $FUSEKI_BASE/config.ttl
RUN mkdir -p $FUSEKI_BASE/databases
# Set permissions to allow fuseki to run as an arbitrary user
RUN chgrp -R 0 $FUSEKI_BASE \
&& chmod -R g+rwX $FUSEKI_BASE
# Tools for loading data
ENV JAVA_CMD java -cp "$FUSEKI_HOME/fuseki-server.jar:/javalibs/*"
COPY load.sh /jena-fuseki/
RUN chmod 755 /jena-fuseki/load.sh
#RUN /jena-fuseki/load.sh
WORKDIR /jena-fuseki
RUN mkdir -p rdf
RUN curl -X GET "https://dados-ufma.herokuapp.com/api/v01/docente/" -H "accept: application/xml" > rdf/docentes.rdf
RUN curl -X GET "https://dados-ufma.herokuapp.com/api/v01/subunidade/" -H "accept: application/xml" > rdf/subunidades.rdf
RUN curl -X GET "https://dados-ufma.herokuapp.com/api/v01/discente/" -H "accept: application/xml" > rdf/discentes.rdf
RUN curl -X GET "https://dados-ufma.herokuapp.com/api/v01/curso/" -H "accept: application/xml" > rdf/cursos.rdf
RUN curl -X GET "https://dados-ufma.herokuapp.com/api/v01/monografia/" -H "accept: application/xml" > rdf/monografias.rdf
EXPOSE $PORT
USER 9008
ENTRYPOINT ["/docker-entrypoint.sh"]
CMD ["/jena-fuseki/fuseki-server"]