From 06c14e985ffcb21a384b2feabed844a5a6c1ecc1 Mon Sep 17 00:00:00 2001 From: Brett Date: Thu, 16 Dec 2021 13:59:49 +0100 Subject: [PATCH] more changes --- README.txt | 34 +++++++++++------------- not-compose.sh | 71 ++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 86 insertions(+), 19 deletions(-) create mode 100755 not-compose.sh diff --git a/README.txt b/README.txt index 37e3dc7..33f2cc2 100644 --- a/README.txt +++ b/README.txt @@ -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 : --mount type=bind,source="$(pwd)"/ckan.ini,target=/srv/app/ckan.ini -d + +Maybe include a script to replace docker-compose if required + + diff --git a/not-compose.sh b/not-compose.sh new file mode 100755 index 0000000..791bb28 --- /dev/null +++ b/not-compose.sh @@ -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