Skip to content

Commit

Permalink
complete docker compose for [ckan]
Browse files Browse the repository at this point in the history
  • Loading branch information
JinSheng03 committed Oct 28, 2024
1 parent 5988d67 commit d816f53
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 45 deletions.
48 changes: 23 additions & 25 deletions apps/ckan/.env
Original file line number Diff line number Diff line change
@@ -1,28 +1,31 @@
# Host Ports
CKAN_PORT_HOST=5001
NGINX_PORT_HOST=81
NGINX_SSLPORT_HOST=8443
# ckan env from: https://github.com/ckan/ckan-docker/blob/master/.env.example
# Websoft9-specific variables
W9_REPO=ckan/ckan-base
W9_DIST=community
W9_VERSION=2.11.0
W9_POWER_PASSWORD=urtghkikljee9uy
W9_ID=ckan

# Port Configurations
W9_HTTP_PORT=5000
W9_HTTP_PORT_SET=5000
W9_NETWORK=websoft9
W9_URL=internet_ip

# CKAN databases
POSTGRES_USER=postgres
#POSTGRES_PASSWORD=postgres
POSTGRES_PASSWORD=postgres
POSTGRES_PASSWORD=$W9_POWER_PASSWORD
POSTGRES_DB=postgres
POSTGRES_HOST=db
#CKAN_DB_USER=ckan_default
CKAN_DB_USER=ckandbuser
CKAN_DB_PASSWORD=ckandbpassword
#CKAN_DB_PASSWORD=pass
CKAN_DB_PASSWORD=$W9_POWER_PASSWORD
CKAN_DB=ckandb
DATASTORE_READONLY_USER=datastore_ro
DATASTORE_READONLY_PASSWORD=datastore
DATASTORE_READONLY_PASSWORD=$W9_POWER_PASSWORD
DATASTORE_DB=datastore
CKAN_SQLALCHEMY_URL=postgresql://ckandbuser:ckandbpassword@db/ckandb
CKAN_DATASTORE_WRITE_URL=postgresql://ckandbuser:ckandbpassword@db/datastore
#CKAN_DATASTORE_WRITE_URL=postgresql://datastore_ro:datastore@db/datastore
#CKAN_SQLALCHEMY_URL=postgresql://ckan_default:ckandbpassword@db/ckandb
#CKAN_DATASTORE_WRITE_URL=postgresql://ckan_default:ckandbpassword@db/datastore
CKAN_DATASTORE_READ_URL=postgresql://datastore_ro:datastore@db/datastore
CKAN_SQLALCHEMY_URL=postgresql://ckandbuser:$W9_POWER_PASSWORD@db/ckandb
CKAN_DATASTORE_WRITE_URL=postgresql://ckandbuser:$W9_POWER_PASSWORD@db/datastore
CKAN_DATASTORE_READ_URL=postgresql://datastore_ro:$W9_POWER_PASSWORD@db/datastore

# Test database connections
TEST_CKAN_SQLALCHEMY_URL=postgres://ckan:ckan@db/ckan_test
Expand All @@ -33,22 +36,21 @@ TEST_CKAN_DATASTORE_READ_URL=postgresql://datastore_ro:datastore@db/datastore_te
USE_HTTPS_FOR_DEV=false

# CKAN core
CKAN_VERSION=2.10.0
CKAN_SITE_ID=default
CKAN_SITE_URL=https://localhost:8443
CKAN_SITE_URL=http://121.41.131.89:5000
CKAN___BEAKER__SESSION__SECRET=CHANGE_ME
# See https://docs.ckan.org/en/latest/maintaining/configuration.html#api-token-settings
CKAN___API_TOKEN__JWT__ENCODE__SECRET=string:CHANGE_ME
CKAN___API_TOKEN__JWT__DECODE__SECRET=string:CHANGE_ME
CKAN_SYSADMIN_NAME=ckan_admin
CKAN_SYSADMIN_PASSWORD=test1234
CKAN_SYSADMIN_PASSWORD=$W9_POWER_PASSWORD
CKAN_SYSADMIN_EMAIL=[email protected]
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
CKAN_SMTP_PASSWORD=$W9_POWER_PASSWORD
CKAN_SMTP_MAIL_FROM=ckan@121.41.131.89
CKAN_MAX_UPLOAD_SIZE_MB=100
TZ=UTC

Expand All @@ -67,10 +69,6 @@ DATAPUSHER_VERSION=0.0.21
CKAN_DATAPUSHER_URL=http://datapusher:8800
CKAN__DATAPUSHER__CALLBACK_URL_BASE=http://ckan:5000

# NGINX
NGINX_PORT=80
NGINX_SSLPORT=443

# Extensions
CKAN__PLUGINS="image_view text_view datatables_view datastore datapusher envvars"
CKAN__HARVEST__MQ__TYPE=redis
Expand Down
43 changes: 25 additions & 18 deletions apps/ckan/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,28 +1,21 @@
volumes:
ckan_storage:
pg_data:
solr_data:
pip_cache:
site_packages:
vscode_server:
# image: https://hub.docker.com/r/ckan/ckan-base
# compose refer to: https://github.com/ckan/ckan-docker/blob/master/docker-compose.yml
# docs: https://docs.ckan.org/en/2.10/maintaining/installing/index.html

services:
version: "3.8"

services:
ckan-dev:
#build:
# context: ckan/
# dockerfile: Dockerfile.dev
# args:
# - TZ=${TZ}
image: ckan/ckan-base:2.11.0
container_name: $W9_ID
image: $W9_REPO:$W9_VERSION
env_file:
- .env
links:
- db
- solr
- redis
ports:
- "0.0.0.0:${CKAN_PORT_HOST}:5000"
- $W9_HTTP_PORT_SET:5000
volumes:
- ckan_storage:/var/lib/ckan
- ./src:/srv/app/src_extensions
Expand All @@ -37,7 +30,8 @@ services:
retries: 3

datapusher:
image: ckan/ckan-base-datapusher:${DATAPUSHER_VERSION}
container_name: $W9_ID-datapusher
image: $W9_REPO-datapusher:${DATAPUSHER_VERSION}
restart: unless-stopped
healthcheck:
test: ["CMD", "wget", "-qO", "/dev/null", "http://localhost:8800"]
Expand All @@ -46,8 +40,7 @@ services:
retries: 3

db:
#build:
# context: postgresql/
container_name: $W9_ID-postgres
image: ckan/ckan-postgres-dev:2.11
environment:
- POSTGRES_USER
Expand All @@ -69,6 +62,7 @@ services:
test: ["CMD", "pg_isready", "-U", "${POSTGRES_USER}", "-d", "${POSTGRES_DB}"]

solr:
container_name: $W9_ID-solr
image: ckan/ckan-solr:${SOLR_IMAGE_VERSION}
volumes:
- solr_data:/var/solr
Expand All @@ -81,3 +75,16 @@ services:
restart: unless-stopped
healthcheck:
test: ["CMD", "redis-cli", "-e", "QUIT"]

volumes:
ckan_storage:
pg_data:
solr_data:
pip_cache:
site_packages:
vscode_server:

networks:
default:
name: $W9_NETWORK
external: true
4 changes: 2 additions & 2 deletions apps/ckan/variables.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
"trademark": "Ckan",
"release": false,
"fork_url": "https://github.com/ckan/ckan",
"version_from": "",
"version_from": "https://hub.docker.com/r/ckan/ckan-base/tags",
"edition": [
{
"dist": "community",
"version": [
"latest"
"2.11.0"
]
}
],
Expand Down

0 comments on commit d816f53

Please sign in to comment.