forked from ckan/ckan-docker
-
Notifications
You must be signed in to change notification settings - Fork 6
/
Dockerfile
93 lines (82 loc) · 4.29 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
FROM ghcr.io/mjanez/ckan-base-spatial:ckan-2.9.11
LABEL maintainer="[email protected]"
# Set up environment variables
ENV APP_DIR=/srv/app
ENV TZ=UTC
# Set working directory
WORKDIR ${APP_DIR}
# requirements.txt files fixed until next releases
COPY req_fixes req_fixes
# CKAN configuration & extensions
## XLoader - 1.0.1 ##
## Harvest - v1.5.6 (Worker with supervisor) ##
## Geoview - v0.1.0 ##
## Spatial - v2.1.1 ##
## DCAT - v1.8.0 (Latest stable version of ckanext-dcat with minor fixes) ##
## Scheming - release-3.0.0 ##
## Resource dictionary - v1.0.1 (mjanez/Fixed version) ##
## Pages - v0.5.2 ##
## PDFView - 0.0.8 ##
## Fluent - v1.0.1 (mjanez/Forked stable version) ##
## Scheming DCAT - v3.2.2 (mjanez/GeoDCAT-AP/NTI-RISP extended version) ##
RUN echo ${TZ} > /etc/timezone && \
if ! [ /usr/share/zoneinfo/${TZ} -ef /etc/localtime ]; then cp /usr/share/zoneinfo/${TZ} /etc/localtime; fi && \
# Remove apk cache
rm -rf /var/cache/apk/* && \
# Install CKAN extensions
echo "ckan/ckanext-xloader" && \
pip3 install --no-cache-dir -e git+https://github.com/ckan/[email protected]#egg=ckanext-xloader && \
pip3 install --no-cache-dir -r ${APP_DIR}/src/ckanext-xloader/requirements.txt && \
pip3 install --no-cache-dir -U requests[security] && \
echo "ckan/ckanext-harvest" && \
pip3 install --no-cache-dir -e git+https://github.com/ckan/[email protected]#egg=ckanext-harvest && \
pip3 install --no-cache-dir -r ${APP_DIR}/src/ckanext-harvest/requirements.txt && \
echo "ckan/ckanext-geoview" && \
pip3 install --no-cache-dir -e git+https://github.com/ckan/[email protected]#egg=ckanext-geoview && \
echo "ckan/ckanext-spatial" && \
pip3 install --no-cache-dir -e git+https://github.com/ckan/[email protected]#egg=ckanext-spatial && \
pip3 install --no-cache-dir -r ${APP_DIR}/req_fixes/ckanext-spatial/requirements.txt && \
echo "mjanez/ckanext-dcat (GeoDCAT-AP extended version)" && \
pip3 install --no-cache-dir -e git+https://github.com/mjanez/[email protected]#egg=ckanext-dcat && \
pip3 install --no-cache-dir -r ${APP_DIR}/src/ckanext-dcat/requirements.txt && \
echo "ckan/ckanext-scheming" && \
pip3 install --no-cache-dir -e git+https://github.com/ckan/[email protected]#egg=ckanext-scheming && \
echo "mjanez/ckanext-resourcedictionary" && \
pip3 install --no-cache-dir -e git+https://github.com/mjanez/[email protected]#egg=ckanext-resourcedictionary && \
echo "ckan/ckanext-pages" && \
pip3 install --no-cache-dir -e git+https://github.com/ckan/[email protected]#egg=ckanext-pages && \
echo "ckan/ckanext-pdfview" && \
pip3 install --no-cache-dir -e git+https://github.com/ckan/[email protected]#egg=ckanext-pdfview && \
echo "mjanez/ckanext-fluent" && \
pip3 install --no-cache-dir -e git+https://github.com/mjanez/[email protected]#egg=ckanext-fluent && \
echo "mjanez/ckanext-schemingdcat" && \
pip3 install --no-cache-dir -e git+https://github.com/mjanez/[email protected]#egg=ckanext_schemingdcat && \
pip3 install --no-cache-dir -r ${APP_DIR}/src/ckanext-schemingdcat/requirements.txt
# Used to configure the container environment by setting environment variables, creating users, running initialization scripts, .etc
COPY docker-entrypoint.d/* /docker-entrypoint.d/
# Update who.ini with PROXY_CKAN_LOCATION
COPY setup/who.ini ./
# Apply any patches needed to CKAN core
COPY patches patches
RUN for d in $APP_DIR/patches/*; do \
if [ -d $d ]; then \
for f in `ls $d/*.patch | sort -g`; do \
cd $SRC_DIR/`basename "$d"` && \
if patch -R --dry-run -p1 < "$f"; then \
echo "$0: Patch $f has already been applied or reversed, skipping..."; \
else \
echo "$0: Applying patch $f to $SRC_DIR/`basename $d`"; \
sed -i 's/\r$//' "$f" && \
patch -p1 < "$f" ; \
fi \
done ; \
fi ; \
done
# Workers
## Update start_ckan.sh with custom workers
COPY setup/start_ckan.sh.override ${APP_DIR}/start_ckan.sh
RUN chmod +x ${APP_DIR}/start_ckan.sh
## Load workers supervisor configuration
COPY setup/workers/* /etc/supervisord.d/
# Start CKAN
CMD ["/bin/sh", "-c", "$APP_DIR/start_ckan.sh"]