HOWTO

Installing CKAN with Docker Compose (ubuntu 16.04)

한크크 2020. 10. 11. 10:20

This Posting is based on https://docs.ckan.org/en/2.9/maintaining/installing/install-from-docker-compose.html

 

Installing CKAN with Docker Compose — CKAN 2.9.0 documentation

Docs » Maintainer’s guide » Installing CKAN » Installing CKAN with Docker Compose Edit on GitHub Installing CKAN with Docker Compose This chapter is a tutorial on how to install the latest CKAN (master or any stable version) with Docker Compose. The s

docs.ckan.org

 

1. Pre-install the packages 

sudo apt-get update
apt-get install python3 python3-setuptools docker.io -y
sudo easy_install3 pip
pip --version 

 

2. upgrade docker-compose version

if you aren't upgrade the docker-compose version, It will be failed when build docker-compose.

sudo apt-get remove docker-compose
sudo curl -L "https://github.com/docker/compose/releases/download/1.23.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
sudo ln -s /usr/local/bin/docker-compose /usr/bin/docker-compose

 

3. install ckan

git clone https://github.com/ckan/ckan.git
git checkout tags/ckan-2.9.0
cd /ckan/contrib/docker
cp -rp .env.template .env
# customize .env before you build.
docker-compose up -d --build

refer to .env file below. 

# DB image settings
POSTGRES_PASSWORD=ckan
DATASTORE_READONLY_PASSWORD=datastore

# Basic
CKAN_SITE_ID=default
CKAN_SITE_URL=http://{your site IP or Domain}:5000
CKAN_PORT=5000
CKAN_SYSADMIN_NAME=ckan_admin
CKAN_SYSADMIN_PASSWORD=test1234
CKAN_SYSADMIN_EMAIL=your_email@example.com
TZ=UTC

# Database connections (TODO: avoid duplication)
CKAN_SQLALCHEMY_URL=postgresql://ckan:ckan@localhost/ckan
CKAN_DATASTORE_WRITE_URL=postgresql://ckan:ckan@localhost/datastore
CKAN_DATASTORE_READ_URL=postgresql://datastore_ro:datastore@localhost/datastore

# Test database connections
TEST_CKAN_SQLALCHEMY_URL=postgres://ckan:ckan@localhost/ckan_test
TEST_CKAN_DATASTORE_WRITE_URL=postgresql://ckan:ckan@localhost/datastore_test
TEST_CKAN_DATASTORE_READ_URL=postgresql://datastore_ro:datastore@localhost/datastore_test

# Other services connections
CKAN_SOLR_URL=http://solr:8983/solr/ckan
CKAN_REDIS_URL=redis://redis:6379/1
CKAN_DATAPUSHER_URL=http://datapusher:8800
#CKAN__DATAPUSHER__CALLBACK_URL_BASE=http://localhost:5000

TEST_CKAN_SOLR_URL=http://solr:8983/solr/ckan
TEST_CKAN_REDIS_URL=redis://redis:6379/1

# Core settings
CKAN__STORAGE_PATH=/var/lib/ckan

CKAN_SMTP_SERVER=smtp.corporateict.domain:25
CKAN_SMTP_STARTTLS=True
CKAN_SMTP_USER=user
CKAN_SMTP_PASSWORD=pass
CKAN_SMTP_MAIL_FROM=ckan@localhost

# Extensions

CKAN__PLUGINS=envvars image_view text_view recline_view datastore datapusher dataproxy dataproxy_view
CKAN__HARVEST__MQ__TYPE=redis
CKAN__HARVEST__MQ__HOSTNAME=redis
CKAN__HARVEST__MQ__PORT=6379
CKAN__HARVEST__MQ__REDIS_DB=1

Customize the configuration values such like SITE_URL, SYSADMIN_NAME, SYSADMIN_PASSWORD.

 

4. Check the installation successfully completed.

docker-compose restart ckan
docker ps | grep ckan
docker-compose logs -f ckan

Access to your site_url domain or IP.

http://{site_url_domain or IP}:5000

If you are using ip address instead of Domain, you have to write down your site IP to production.ini in ckan container. 

docker exec -it ckan /bin/bash
ckan@67f980bc1970:/$ vi /etc/ckan/production.ini

write down your site ip to ckan.site_url.

 

 

반응형