more changes

This commit is contained in:
Brett 2021-12-16 13:59:49 +01:00
parent da98af0ddb
commit 06c14e985f
2 changed files with 86 additions and 19 deletions

View File

@ -1,27 +1,23 @@
### Please note that this re-purposed CKAN Docker repo is a WORK IN PROGRESS ###
### It should not be used to install CKAN via Docker until this page is updated ###
- Maybe use build/up time variables loaded via the .env file, runtime variables loaded via a .ckan-env file - both
located at the root directory
- Look at using ghcr.io (GitHub Packages) to store Docker Images rather than DockerHub
- all username/passwords as environment variables rather than hardcoded
- make sure the "development mode" path is taken cared of with any change
- Create an admin user during the container deployment
- should there be a datapusher image pre-built like ckan? maybe an xloader image?
(From Adria)
Be limited in scope, and act as a base that users can extend to their own needs
Be opinionated, and provide one way to do things
Be automatically tested
### Difference between ckan-base and ckan-dev ###
ckan-base
docker-compose up -d --build
docker-compose build
docker-compose up
ckan-dev
docker-compose -f docker-compose.dev.yml up -d --build
docker-compose -f docker-compose.dev.yml build
docker-compose -f docker-compose.dev.yml up
have an nginx container included?
ARG should be used for sensitive variables so as to keep the values of these variables
out of the build and hence will not show with an "inspect image" command
Do we pre-build a CKAN image and use that (and extend) as the base image OR
just build it from scratch and while saving to storage what we need to
Use a bind mount for the config file (ckan.ini)
docker cp ckan:/srv/app/ckan.ini ./ckan.ini
docker run -p <port1>:<port2> --mount type=bind,source="$(pwd)"/ckan.ini,target=/srv/app/ckan.ini -d <ckan_base_image>
Maybe include a script to replace docker-compose if required

71
not-compose.sh Executable file
View File

@ -0,0 +1,71 @@
#!/bin/bash
#
# Create the network first
#
docker network create ckan-net
#
# Redis - Run only (image already built)
#
REDIS_CONTAINERNAME=redis
REDIS_HOSTNAME=redis
docker run -d -it --net ckan-net --name ${REDIS_CONTAINERNAME} --hostname ${REDIS_HOSTNAME} redis:latest
#
# Solr - Run/Build
#
SOLR_CONTAINERNAME=solr
SOLR_HOSTNAME=solr
SOLR_IMAGENAME=solr
cd solr
docker image build -t ${SOLR_IMAGENAME} .
docker run -d -it --net ckan-net --name ${SOLR_CONTAINERNAME} --hostname ${SOLR_HOSTNAME} \
-v solr_core:/opt/solr/server/solr ${SOLR_IMAGENAME}
cd -
#
# PostgreSQL (DB) - Run/Build
#
DB_CONTAINERNAME=db
DB_HOSTNAME=db
DB_IMAGENAME=db
cd postgresql
docker image build -t ${DB_IMAGENAME} .
docker run -d -it --net ckan-net --name ${DB_CONTAINERNAME} --hostname ${DB_HOSTNAME} --env-file=../environ \
-v pg_data:/var/lib/postgresql/data ${DB_IMAGENAME}
cd -
#
# CKAN - Run/Build
#
CKAN_CONTAINERNAME=ckan
CKAN_HOSTNAME=ckan
CKAN_IMAGENAME=ckan
cd ckan
docker image build -t ${CKAN_IMAGENAME} .
docker run -d -it --net ckan-net --name ${CKAN_CONTAINERNAME} --hostname ${CKAN_HOSTNAME} --env-file=../environ \
-v ckan_storage:/var/lib/ckan ${CKAN_IMAGENAME}
cd -
#
# Nginx - Run/Build
#
NGINX_CONTAINERNAME=nginx
NGINX_HOSTNAME=nginx
NGINX_IMAGENAME=nginx
cd nginx
docker image build -t ${NGINX_IMAGENAME} .
docker run -d -it --net ckan-net --name ${NGINX_CONTAINERNAME} --hostname ${NGINX_HOSTNAME} -p 0.0.0.0:80:80 ${NGINX_IMAGENAME}
cd -
#
# PostgreSQL client
#
docker run -d -it --net ckan-net --name postgres-client --hostname postgres-client -e POSTGRES_PASSWORD=ckan -p 5432:5432 postgres