diff --git a/ckan/Dockerfile b/ckan/Dockerfile index 951bf4bfe..e6b33231b 100644 --- a/ckan/Dockerfile +++ b/ckan/Dockerfile @@ -53,7 +53,7 @@ RUN for d in $APP_DIR/patches/*; do \ fi ; \ done -ENV CKAN__PLUGINS="envvars image_view text_view recline_view scheming_datasets scheming_organizations dcat dcat_json_interface harvest ckan_harvester dcat_rdf_harvester dcat_json_harvester fairdatapointharvester oidc_pkce gdi_userportal activity" +ENV CKAN__PLUGINS="envvars image_view text_view recline_view scheming_datasets scheming_organizations dcat dcat_json_interface harvest ckan_harvester dcat_rdf_harvester dcat_json_harvester fairdatapointharvester oidc_pkce gdi_userportal activity multilingual_dataset multilingual_group multilingual_tag" COPY --chown=ckan:ckan setup/prerun.py ${APP_DIR} diff --git a/ckan/Dockerfile.dev b/ckan/Dockerfile.dev index f37f886ff..295d82cfd 100644 --- a/ckan/Dockerfile.dev +++ b/ckan/Dockerfile.dev @@ -47,4 +47,4 @@ RUN for d in $APP_DIR/patches/*; do \ fi ; \ done -ENV CKAN__PLUGINS="envvars image_view text_view recline_view scheming_datasets scheming_organizations gdi_userportal dcat harvest ckan_harvester dcat_rdf_harvester dcat_json_harvester dcat_json_interface oidc_pkce fairdatapointharvester activity" +ENV CKAN__PLUGINS="envvars image_view text_view recline_view scheming_datasets scheming_organizations gdi_userportal dcat harvest ckan_harvester dcat_rdf_harvester dcat_json_harvester dcat_json_interface oidc_pkce fairdatapointharvester activity multilingual_dataset multilingual_group multilingual_tag" diff --git a/ckan/prepopulate_db/common_vocabulary_tags.csv b/ckan/prepopulate_db/common_vocabulary_tags.csv new file mode 100644 index 000000000..87e55cf76 --- /dev/null +++ b/ckan/prepopulate_db/common_vocabulary_tags.csv @@ -0,0 +1,35 @@ +term,term_translation,lang_code +http://id.loc.gov/vocabulary/iso639-1/en,English,en +http://id.loc.gov/vocabulary/iso639-1/nl,Dutch,en +http://id.loc.gov/vocabulary/iso639-1/de,German,en +http://id.loc.gov/vocabulary/iso639-1/fr,French,en +http://id.loc.gov/vocabulary/iso639-1/lb,Luxembourgish,en +https://publications.europa.eu/resource/authority/language/ENG,English,en +https://publications.europa.eu/resource/authority/language/LTZ,Luxembourgish,en +https://publications.europa.eu/resource/authority/language/DEU,German,en +https://publications.europa.eu/resource/authority/language/FRA,French,en +http://publications.europa.eu/resource/authority/access-right/PUBLIC,Public,en +http://publications.europa.eu/resource/authority/access-right/RESTRICTED,Restricted,en +http://publications.europa.eu/resource/authority/access-right/NON_PUBLIC,Non-public,en +http://purl.org/adms/status/Completed,Completed,en +http://purl.org/adms/status/Deprecated,Deprecated,en +http://purl.org/adms/status/UnderDevelopment,UnderDevelopment,en +http://purl.org/adms/status/Withdrawn,Withdrawn,en +http://purl.org/cld/freq/triennial,triennial,en +http://purl.org/cld/freq/biennial,biennial,en +http://purl.org/cld/freq/annual,annual,en +http://purl.org/cld/freq/semiannual,semiannual,en +http://purl.org/cld/freq/threeTimesAYear,three times a year,en +http://purl.org/cld/freq/quarterly,quarterly,en +http://purl.org/cld/freq/bimonthly,bimonthly,en +http://purl.org/cld/freq/monthly,monthly,en +http://purl.org/cld/freq/semimonthly,semimonthly,en +http://purl.org/cld/freq/biweekly,biweekly,en +http://purl.org/cld/freq/threeTimesAMonth,three times a month,en +http://purl.org/cld/freq/weekly,weekly,en +http://purl.org/cld/freq/semiweekly,semiweekly,en +http://purl.org/cld/freq/threeTimesAWeek,three times a week,en +http://purl.org/cld/freq/daily,daily,en +http://purl.org/cld/freq/continuous,continuous,en +http://purl.org/cld/freq/irregular,irregular,en +https://bioportal.bioontology.org/ontologies/ICD10CM?p=classes&conceptid=U07.1,COVID-19,en \ No newline at end of file diff --git a/ckan/prepopulate_db/upload_vocabulary.sh b/ckan/prepopulate_db/upload_vocabulary.sh new file mode 100644 index 000000000..86464c407 --- /dev/null +++ b/ckan/prepopulate_db/upload_vocabulary.sh @@ -0,0 +1,5 @@ +#!/bin/bash + +set -e + +psql postgresql://$POSTGRES_USER:$POSTGRES_PASSWORD@$POSTGRES_HOST:5432/$CKAN_DB -c "\copy public.term_translation FROM '/prepopulate_db/common_vocabulary_tags.csv' WITH (DELIMITER ',', FORMAT CSV, HEADER TRUE);" diff --git a/docker-compose.yml b/docker-compose.yml index 05afcd5ee..fd975a82c 100755 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -33,7 +33,7 @@ services: - ./src:/srv/app/src_extensions restart: unless-stopped healthcheck: - test: ["CMD", "wget", "-qO", "/dev/null", "http://localhost:5500"] + test: ["CMD", "wget", "-qO", "/dev/null", "http://localhost:${CKAN_PORT}"] postgres: build: @@ -90,3 +90,19 @@ services: - KC_HOSTNAME healthcheck: test: ["CMD", "curl", "-o", "/dev/null", http://localhost:8080/health/ready"] + + populate_db: + container_name: populate_db + command: + - "/bin/sh" + - "/prepopulate_db/upload_vocabulary.sh" + depends_on: + ckan-dev: + condition: service_healthy + postgres: + condition: service_healthy + env_file: + - .env + image: rtdl/psql-client:latest + volumes: + - ./ckan/prepopulate_db:/prepopulate_db