-
Notifications
You must be signed in to change notification settings - Fork 5
/
Dockerfile-ckan
43 lines (33 loc) · 1.98 KB
/
Dockerfile-ckan
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
###################
### Extensions ####
###################
FROM ghcr.io/keitaroinc/ckan:2.9.6
# Switch to the root user
USER root
# Install any system packages necessary to build extensions
# Make sure we install python 3.8, cause CKAN is not compatible with 3.9
RUN apk add --no-cache --repository=https://dl-cdn.alpinelinux.org/alpine/v3.8/main/
RUN echo http://dl-2.alpinelinux.org/alpine/edge/community/ >> /etc/apk/repositories
# Fetch and build the custom CKAN extensions
RUN pip install -e "git+https://github.com/Marvell-Consulting/ckanext-scheming.git#egg=ckanext-scheming"
RUN pip install -e "git+https://github.com/Marvell-Consulting/ckanext-pages.git#egg=ckanext-pages"
RUN pip install -e "git+https://github.com/Marvell-Consulting/ckanext-download-csv-button#egg=ckanext-download-csv-button"
RUN pip install -e "git+https://github.com/Marvell-Consulting/ckanext-nhs-theme#egg=ckanext-nhs-theme"
# Add the custom extensions to the plugins list
ENV CKAN__PLUGINS envvars image_view text_view recline_view datastore datapusher scheming_datasets scheming_organizations pages download_csv_button nhs_theme
# Configure ckan
RUN ckan config-tool ${APP_DIR}/production.ini "ckan.plugins = ${CKAN__PLUGINS}"
RUN ckan config-tool ${APP_DIR}/production.ini "scheming.dataset_schemas = ckanext.scheming:nhs_dataset.yaml"
RUN ckan config-tool ${APP_DIR}/production.ini "scheming.organization_schemas = ckanext.scheming:nhs_org.json"
RUN ckan config-tool ${APP_DIR}/production.ini "ckanext.pages.allow_html = true"
# https://docs.ckan.org/en/2.9/maintaining/tracking.html
RUN ckan config-tool ${APP_DIR}/production.ini "ckan.tracking_enabled = true"
RUN cd /srv/app/src/ckanext-scheming && python setup.py develop
RUN cd /srv/app/src/ckanext-pages && python setup.py develop
RUN cd /srv/app/src/ckanext-nhs-theme && python setup.py develop
RUN apk --no-cache add shadow && usermod -u 999 ckan
RUN chown -R ckan:ckan /srv/app
RUN mkdir /var/lib/ckan
RUN chown -R ckan:ckan /var/lib/ckan
# Switch to the ckan user
USER ckan