From 98aaff23c4c00bc608efacea637d6d52111833d7 Mon Sep 17 00:00:00 2001 From: Brett Date: Mon, 11 Jul 2022 13:32:17 +0200 Subject: [PATCH] More updates --- .env | 2 +- README.txt | 7 +- docker-compose.yml | 98 +++++++++++++-------------- nginx/Dockerfile | 8 +-- nginx/setup/nginx.conf | 34 ---------- nginx/setup/sites-available/ckan.conf | 2 +- 6 files changed, 58 insertions(+), 93 deletions(-) delete mode 100644 nginx/setup/nginx.conf diff --git a/.env b/.env index 29e9bcf..a0f2bb5 100644 --- a/.env +++ b/.env @@ -34,7 +34,7 @@ CKAN_SOLR_URL=http://solr:8983/solr/ckan TEST_CKAN_SOLR_URL=http://solr:8983/solr/ckan # Redis -REDIS_VERSION=6.0.7 +REDIS_VERSION=6 CKAN_REDIS_URL=redis://redis:6379/1 TEST_CKAN_REDIS_URL=redis://redis:6379/1 diff --git a/README.txt b/README.txt index 4e4e15d..b5ae896 100644 --- a/README.txt +++ b/README.txt @@ -1,4 +1,4 @@ -# July 7 2022 +# (from) July 7 2022 # This repo will be actively worked on from now. # This file will be my ToDo list of things to take care of @@ -10,7 +10,8 @@ All the other images should live in separate repos 1. Solr - use ckan-solr (https://github.com/ckan/ckan-solr) 2. PostgreSQL - use current method (base image: postgres:12-alpine from DockerHub, enhanced in a Dockerfile) ### This may change to be more like Solr though -3. Redis - use current method (DockerHub image: redis:${REDIS_VERSION} specified as a compose service in the compose file) +3. Redis - use current method (DockerHub image: redis:${REDIS_VERSION} specified as a compose service in the compose file) + latest image to used is redis:6 4. nginx - base image: nginx:1.19.8-alpine from DockerHub, enhanced in a Dockerfile) 5. DataPusher - built from the actual datapusher repo (https://github.com/ckan/datapusher) 6. CKAN Worker - add new (ckan worker) container in the compose setup @@ -25,4 +26,4 @@ Go through all the new changes in the current repo and use those for the new rep - Make asure ARGs are used if they are added to compose file - Check out Florian's docs https://github.com/dbca-wa/ckan/blob/dbca2022/doc/maintaining/installing/install-from-docker-compose.rst - Check out Florian's repo https://github.com/dbca-wa/ckan/tree/dbca2022 - +- Documentation to be re-done from scratch...anything that could be useful can be mentioned here eg: local storage for ckan.ini diff --git a/docker-compose.yml b/docker-compose.yml index 0d8dffa..26d15ee 100755 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -7,62 +7,62 @@ services: build: context: nginx/ dockerfile: Dockerfile - links: - - ckan + #links: + # - ckan ports: - - "0.0.0.0:80:80" + - "0.0.0.0:81:80" - ckan: - container_name: ckan - build: - context: ckan/ - dockerfile: Dockerfile - args: - - TZ=${TZ} - env_file: - - .env - links: - - db - - solr - - redis - - datapusher - ports: - - "0.0.0.0:${CKAN_PORT}:5000" - volumes: - - ckan_storage:/var/lib/ckan + #ckan: + # container_name: ckan + # build: + # context: ckan/ + # dockerfile: Dockerfile + # args: + # - TZ=${TZ} + # env_file: + # - .env + # links: + # - db + # - solr + # - redis + # - datapusher + # ports: + # - "0.0.0.0:${CKAN_PORT}:5000" + # volumes: + # - ckan_storage:/var/lib/ckan - datapusher: - container_name: datapusher - image: kowhai/datapusher:${DATAPUSHER_VERSION} - ports: - - "8800:8800" + #datapusher: + # container_name: datapusher + # image: kowhai/datapusher:${DATAPUSHER_VERSION} + # ports: + # - "8800:8800" - db: - container_name: db - build: - context: postgresql/ - args: - - DATASTORE_READONLY_PASSWORD=${DATASTORE_READONLY_PASSWORD} - - POSTGRES_PASSWORD=${POSTGRES_PASSWORD} - environment: - - DATASTORE_READONLY_PASSWORD=${DATASTORE_READONLY_PASSWORD} - - POSTGRES_PASSWORD=${POSTGRES_PASSWORD} - - PGDATA=/var/lib/postgresql/data/db - volumes: - - pg_data:/var/lib/postgresql/data + #db: + # container_name: db + # build: + # context: postgresql/ + # args: + # - DATASTORE_READONLY_PASSWORD=${DATASTORE_READONLY_PASSWORD} + # - POSTGRES_PASSWORD=${POSTGRES_PASSWORD} + # environment: + # - DATASTORE_READONLY_PASSWORD=${DATASTORE_READONLY_PASSWORD} + # - POSTGRES_PASSWORD=${POSTGRES_PASSWORD} + # - PGDATA=/var/lib/postgresql/data/db + # volumes: + # - pg_data:/var/lib/postgresql/data - solr: - container_name: solr - build: - context: solr/ - volumes: - - solr_data:/opt/solr/server/solr/ckan/data/index + #solr: + # container_name: solr + # build: + # context: solr/ + # volumes: + # - solr_data:/opt/solr/server/solr/ckan/data/index redis: container_name: redis image: redis:${REDIS_VERSION} -volumes: - ckan_storage: - pg_data: - solr_data: +#volumes: +# ckan_storage: +# pg_data: +# solr_data: diff --git a/nginx/Dockerfile b/nginx/Dockerfile index 8bdcef2..b83251c 100644 --- a/nginx/Dockerfile +++ b/nginx/Dockerfile @@ -1,15 +1,13 @@ -FROM nginx:alpine +FROM nginx:stable-alpine ENV NGINX_DIR=/etc/nginx -COPY setup/index.html /usr/share/nginx/html/index.html - RUN mkdir -p ${NGINX_DIR}/sites-available RUN mkdir -p ${NGINX_DIR}/sites-enabled -COPY setup/nginx.conf ${NGINX_DIR} +COPY setup/index.html /usr/share/nginx/html/index.html COPY setup/sites-available/* ${NGINX_DIR}/sites-available RUN ln -s ${NGINX_DIR}/sites-available/ckan.conf ${NGINX_DIR}/sites-enabled/ckan.conf -EXPOSE 80 +EXPOSE 81 \ No newline at end of file diff --git a/nginx/setup/nginx.conf b/nginx/setup/nginx.conf deleted file mode 100644 index 7f06cea..0000000 --- a/nginx/setup/nginx.conf +++ /dev/null @@ -1,34 +0,0 @@ - -user nginx; -worker_processes auto; - -error_log /var/log/nginx/error.log warn; -pid /var/run/nginx.pid; - - -events { - worker_connections 1024; -} - - -http { - include /etc/nginx/mime.types; - default_type application/octet-stream; - - log_format main '$remote_addr - $remote_user [$time_local] "$request" ' - '$status $body_bytes_sent "$http_referer" ' - '"$http_user_agent" "$http_x_forwarded_for"'; - - access_log /var/log/nginx/access.log main; - - sendfile on; - #tcp_nopush on; - - keepalive_timeout 65; - - #gzip on; - - include /etc/nginx/sites-enabled/*.conf; -} - - diff --git a/nginx/setup/sites-available/ckan.conf b/nginx/setup/sites-available/ckan.conf index 7ffc6bb..9f1d32e 100644 --- a/nginx/setup/sites-available/ckan.conf +++ b/nginx/setup/sites-available/ckan.conf @@ -4,7 +4,7 @@ proxy_temp_path /tmp/nginx_proxy 1 2; server { client_max_body_size 100M; location / { - proxy_pass http://ckan:5000/; + #proxy_pass http://ckan:5000/; proxy_set_header X-Forwarded-For $remote_addr; proxy_set_header Host $host; proxy_cache cache;