Merge pull request #59 from mjanez/fix/nginx-multilocations

Fix/nginx multilocations
This commit is contained in:
mjanez 2023-07-26 22:23:14 +02:00 committed by GitHub
commit ab4b99133b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
17 changed files with 375 additions and 183 deletions

View File

@ -32,15 +32,18 @@ TEST_CKAN_REDIS_URL=redis://redis:6379/1
# NGINX
NGINX_PORT=80
NGINX_SSLPORT=443
NGINX_LOG_DIR=/var/log/nginx
# Apache HTTP Server
APACHE_VERSION=2.4-alpine
APACHE_PORT=80
APACHE_LOG_DIR=/var/log/apache
APACHE_SERVER_NAME=localhost
# Check CKAN__ROOT_PATH and CKANEXT__DCAT__BASE_URI. If you don't need to use domain locations, it is better to use the nginx configuration. Leave blank or use the root `/`.
APACHE_CKAN_LOCATION=/catalog
APACHE_PYCSW_LOCATION=/csw
#NIGNX/APACHE
## Check CKAN__ROOT_PATH and CKANEXT__DCAT__BASE_URI. If you don't need to use domain locations, it is better to use the nginx configuration. Leave blank or use the root `/`.
PROXY_SERVER_NAME=localhost
PROXY_CKAN_LOCATION=/catalog
PROXY_PYCSW_LOCATION=/csw
# pycsw
PYCSW_PORT=8000
@ -76,7 +79,7 @@ TEST_CKAN_DATASTORE_READ_URL=postgresql://datastore_ro:datastore@db/datastore_te
## If use docker-compose.ghcr.yml only "*.*.*" versions available in: https://github.com/mjanez/ckan-docker/pkgs/container/ckan-spatial
CKAN_VERSION=2.9.9
CKAN_SITE_ID=default
# CKAN_SITE_URL = http:/ or https:/ + APACHE_SERVER_NAME. Optionally the APACHE_HOST_PORT if different from 80
# CKAN_SITE_URL = http:/ or https:/ + PROXY_SERVER_NAME. Optionally the APACHE_HOST_PORT if different from 80
CKAN_SITE_URL=http://localhost
CKAN__ROOT_PATH=/catalog/{{LANG}}
CKAN_PORT=5000

View File

@ -40,26 +40,25 @@ The non-CKAN images are as follows:
* PostgreSQL: [Custom image](/postgresql/Dockerfile) based on official PostgreSQL image. Database files are stored in a named volume.
* Solr: CKAN's [pre-configured Solr image](https://github.com/ckan/ckan-solr). The index data is stored in a named volume and has a spatial schema. [^2]
* Redis: standard Redis image
* Apache HTTP Server: [Custom image](/apache/Dockerfile) based on official latest stable httpd image. Configured to serve multiple routes for the [ckan-pycsw](#ckan-pycsw) CSW endpoint (`{CKAN_SITE_URL}/csw`) and CKAN (`{CKAN_SITE_URL}/catalog`).
* NGINX: latest stable nginx image that includes SSL and Non-SSL endpoints.
* ckan-pycsw: [Custom image](/ckan-pycsw/Dockerfile) based on [pycsw CKAN harvester ISO19139](https://github.com/mjanez/ckan-pycsw) for INSPIRE Metadata CSW Endpoint.
Optional HTTP Endpoint ([`docker-compose.nginx.yml`](/docker-compose.nginx.yml)):
* `docker-compose.nginx.yml`:
* NGINX: latest stable nginx image that includes SSL and Non-SSL endpoints instead of Apache HTTP Server. No locations, no ckan-pycsw, only CKAN.
Optional HTTP Endpoint ([`docker-compose.apache.yml`](/docker-compose.apache.yml)):
* `docker-compose.apache.yml`:
* Apache HTTP Server: [Custom image](/apache/Dockerfile) based on official latest stable httpd image. Configured to serve multiple routes for the [ckan-pycsw](#ckan-pycsw) CSW endpoint (`{CKAN_SITE_URL}/csw`) and CKAN (`{CKAN_SITE_URL}/catalog`). Only HTTP.
| Compose files | Repository | Type | Docker tag | Size | Notes |
| --- | --- | --- | --- | --- | --- |
| [`docker-compose.yml`](/docker-compose.yml) / [`docker-compose.nginx.yml`](/docker-cospatianginx.yml) | CKAN 2.9.8 | custom image | [`mjanez/ckan-spatial:ckan-2.9.8`](https://github.com/mjanez/ckan-docker/pkgs/container/ckan-spatial) | 800 MB | Custom Dockerfile: [`ckan/Dockerfile`](/ckan/Dockerfile) |
| [`docker-compose.yml`](/docker-compose.yml) / [`docker-compose.nginx.yml`](/docker-compose.nginx.yml) | PostgreSQL 15.2 | base image | [`postgres/postgres:15-alpine`](https://hub.docker.com/layers/library/postgres/15-alpine/images/sha256-53a02ecbe9d18ff6476e6651c34811da39f054424c725fc15d2b480fc3fab877?context=explore) | 89.74 MB | Custom Dockerfile: [`postgresql/Dockerfile`](/postgresql/Dockerfile) |
| [`docker-compose.yml`](/docker-compose.yml) / [`docker-compose.nginx.yml`](/docker-compose.nginx.yml) | Solr 8.11.1 | custom image | [`ckan/ckan-solr:2.9-solr8-spatial`](https://registry.hub.docker.com/layers/ckan/ckan-solr/2.9-solr8-spatial/images/sha256-b5ee4979891c7dd1f10d2ac2cbdd4d80ff656879edb0f0493616be7b4cf8bc3a?context=explore) | 331.1 MB | CKAN's [pre-configured spatial Solr image](https://github.com/ckan/ckan-solr). |
| [`docker-compose.yml`](/docker-compose.yml) / [`docker-compose.nginx.yml`](/docker-compose.nginx.yml) | Redis 7.0.10 | base image | [`redis/redis:7-alpine`](https://hub.docker.com/layers/library/redis/7-alpine/images/sha256-98f4ea44e912d0941d29015a4e2448151b94411109c896b5627d94d79306eea7?context=explore) | 11.82 MB | - |
| [`docker-compose.yml`](/docker-compose.yml) / [`docker-compose.apache.yml`](/docker-compose.apache.yml) | CKAN 2.9.8 | custom image | [`mjanez/ckan-spatial:ckan-2.9.8`](https://github.com/mjanez/ckan-docker/pkgs/container/ckan-spatial) | 800 MB | Custom Dockerfile: [`ckan/Dockerfile`](/ckan/Dockerfile) |
| [`docker-compose.yml`](/docker-compose.yml) / [`docker-compose.apache.yml`](/docker-compose.apache.yml) | PostgreSQL 15.2 | base image | [`postgres/postgres:15-alpine`](https://hub.docker.com/layers/library/postgres/15-alpine/images/sha256-53a02ecbe9d18ff6476e6651c34811da39f054424c725fc15d2b480fc3fab877?context=explore) | 89.74 MB | Custom Dockerfile: [`postgresql/Dockerfile`](/postgresql/Dockerfile) |
| [`docker-compose.yml`](/docker-compose.yml) / [`docker-compose.apache.yml`](/docker-compose.apache.yml) | Solr 8.11.1 | custom image | [`ckan/ckan-solr:2.9-solr8-spatial`](https://registry.hub.docker.com/layers/ckan/ckan-solr/2.9-solr8-spatial/images/sha256-b5ee4979891c7dd1f10d2ac2cbdd4d80ff656879edb0f0493616be7b4cf8bc3a?context=explore) | 331.1 MB | CKAN's [pre-configured spatial Solr image](https://github.com/ckan/ckan-solr). |
| [`docker-compose.yml`](/docker-compose.yml) / [`docker-compose.apache.yml`](/docker-compose.apache.yml) | Redis 7.0.10 | base image | [`redis/redis:7-alpine`](https://hub.docker.com/layers/library/redis/7-alpine/images/sha256-98f4ea44e912d0941d29015a4e2448151b94411109c896b5627d94d79306eea7?context=explore) | 11.82 MB | - |
| [`docker-compose.yml`](/docker-compose.yml) | Apache HTTP Server 2.4 | custom image | [`httpd/httpd:2.4`](https://hub.docker.com/layers/library/httpd/2.4/images/sha256-f34e8e25ee18da020633ef0b2bf7516d8cfdad5c5c4b0595d36e5cd78a098101?context=explore) | 54.47 MB | Custom Dockerfile: [`apache/Dockerfile`](/apache/Dockerfile) |
| [`docker-compose.yml`](/docker-compose.yml)| pycsw CKAN harvester ISO19139 | custom image | [`mjanez/ckan-pycsw:latest`](https://github.com/mjanez/ckan-pycsw/pkgs/container/ckan-pycsw) | 175 MB | Custom Dockerfile: [`ckan-pycsw/Dockerfile`](/ckan-pycsw/Dockerfile) |
| [`docker-compose.nginx.yml`](/docker-compose.nginx.yml) | NGINX 1.22.1 | base image | [`nginx:stable-alpine`](https://hub.docker.com/layers/library/nginx/stable-alpine/images/sha256-ff2a5d557ca22fa93669f5e70cfbeefda32b98f8fd3d33b38028c582d700f93a?context=explore) | 9.74 MB | No routing, only CKAN. Custom Dockerfile: [`nginx/Dockerfile`](/nginx/Dockerfile) |
| [`docker-compose.apache.yml`](/docker-compose.apache.yml) | NGINX 1.22.1 | base image | [`nginx:stable-alpine`](https://hub.docker.com/layers/library/nginx/stable-alpine/images/sha256-ff2a5d557ca22fa93669f5e70cfbeefda32b98f8fd3d33b38028c582d700f93a?context=explore) | 9.74 MB | No routing, only CKAN. Custom Dockerfile: [`nginx/Dockerfile`](/nginx/Dockerfile) |
The site is configured using environment variables that you can set in the `.env` file for an Apache HTTP Server and ckan-pycsw deployment (default `.env.example`), or replace it with the [`.env.nginx.example`](/samples/.env.nginx.example) for a NGINX and CKAN-only deployment using the Docker Compose file: [`docker-compose.nginx.yml`](/docker-compose.nginx.yml).
The site is configured using environment variables that you can set in the `.env` file for an NGINX and ckan-pycsw deployment (default `.env.example`), or replace it with the [`.env.apache.example`](/samples/.env.apache.example) for a Apache HTTP Server deployment using the Docker Compose file: [`docker-compose.apache.yml`](/docker-compose.apache.yml).
### ckan-docker roadmap
@ -118,9 +117,9 @@ Use this if you are a maintainer and will not be making code changes to CKAN or
cp .env.example .env
```
- **Apache HTTP Server & CKAN/ckan-pycsw endpoints**: Modifiy the variables about the site URL or locations (`CKAN_SITE_URL` `CKAN_URL`, `PYCSW_URL`, `CKANEXT__DCAT__BASE_URI`, `APACHE_SERVER_NAME`, `APACHE_CKAN_LOCATION`, `APACHE_PYCSW_LOCATION`, etc.).
- **NGINX & CKAN/ckan-pycsw endpoints**: Modifiy the variables about the site URL or locations (`CKAN_SITE_URL` `CKAN_URL`, `PYCSW_URL`, `CKANEXT__DCAT__BASE_URI`, `PROXY_SERVER_NAME`, `PROXY_CKAN_LOCATION`, `PROXY_PYCSW_LOCATION`, etc.).
- **NGINX only CKAN**: Replace the [`.env`](/.env) with the [`/samples/.env.nginx.example`](/samples/.env.nginx.example) and modify the variables as needed.
- **Apache HTTP Server**: Replace the [`.env`](/.env) with the [`/samples/.env.apache.example`](/samples/.env.apache.example) and modify the variables as needed.
>**Note**:<br>
> Please note that when accessing CKAN directly (via a browser) ie: not going through Apache/NGINX you will need to make sure you have "ckan" set up to be an alias to localhost in the local hosts file. Either that or you will need to change the `.env` entry for `CKAN_SITE_URL`
@ -149,7 +148,7 @@ window for something else.
>**Note**<br>
> * Or `docker compose up --build` to build & up the containers.
> * Or `docker compose -f docker-compose.nginx.yml up -d --build` to use the NGINX version.
> * Or `docker compose -f docker-compose.apache.yml up -d --build` to use the Apache HTTP Server version.
>**Note**<br>
> Learn more about configuring this ckan docker:
@ -158,11 +157,11 @@ window for something else.
At the end of the container start sequence there should be 6 containers running (or 5 if use NGINX Docker Compose file)
After this step, CKAN should be running at {`APACHE_SERVER_NAME`}{`APACHE_CKAN_LOCATION`} and ckan-pycsw at {`APACHE_SERVER_NAME`}{`APACHE_PYCSW_LOCATION`}, i.e: http://localhost/catalog or http://localhost/csw
After this step, CKAN should be running at {`PROXY_SERVER_NAME`}{`PROXY_CKAN_LOCATION`} and ckan-pycsw at {`PROXY_SERVER_NAME`}{`PROXY_PYCSW_LOCATION`}, i.e: http://localhost/catalog or http://localhost/csw
|CONTAINER ID |IMAGE |COMMAND|CREATED|STATUS|PORTS|NAMES|
|------------|----------------------------------|--------------------|-------|-------|------|-----|
|0217537f717e|ckan-docker-apache |/docker-entrypoint.…|6 minutes ago |Up 4 minutes|80/tcp,0.0.0.0:80->80/tcp | apache |
|0217537f717e|ckan-docker-nginx |/docker-entrypoint.…|6 minutes ago |Up 4 minutes|80/tcp,0.0.0.0:80->80/tcp,0.0.0.0:8443->443/tcp | nginx |
|7b06ab2e060a|ckan-docker-ckan|/srv/app/start_ckan…|6 minutes ago |Up 5 minutes (healthy)|0.0.0.0:5000->5000/tcp|ckan | |
|1b8d9789c29a|redis:7-alpine |docker-entrypoint.s…|6 minutes ago |Up 4 minutes (healthy)|6379/tcp |redis | |
|7f162741254d|ckan/ckan-solr:2.9-solr8-spatial |docker-entrypoint.s…|6 minutes ago |Up 4 minutes (healthy)|8983/tcp |solr | |
@ -345,36 +344,51 @@ command: `python -m pdb /usr/lib/ckan/venv/bin/ckan --config /srv/app/ckan.ini r
The Datastore database and user is created as part of the entrypoint scripts for the db container.
### Apache HTTP Server
The default Docker Compose configuration ([`docker-compose.yml`](/docker-compose.yml)) uses an httpd image as the front-end. It has two routes for the ckan (default location: `/catalog`) and ckan-pycsw (default location: `/csw`) services.
Both web locations can be modified in the `.env` file:
```ini
...
# Apache HTTP Server
APACHE_VERSION=2.4
APACHE_PORT=80
APACHE_LOG_DIR=/var/log/apache
APACHE_SERVER_NAME=mjanez-cautious-lamp-4pjq9vpg967hq447-80.preview.app.github.dev
# Check CKAN__ROOT_PATH and CKANEXT__DCAT__BASE_URI. If you don't need to use domain locations, it is better to use the nginx configuration. Leave blank or use the root `/`.
APACHE_CKAN_LOCATION=/catalog
APACHE_PYCSW_LOCATION=/csw
...
```
### NGINX
>**Warning**<br>
> The [nginx docker compose file](/docker-compose.nginx.yml) only deploys the CKAN service, not ckan-pycsw.
The default Docker Compose configuration ([`docker-compose.yml`](/docker-compose.yml)) uses an NGINX image as the front-end (ie: reverse proxy). It includes HTTPS running on port number 8443 and an HTTP port (81). A "self-signed" SSL certificate is generated beforehand and the server certificate and key files are included. The NGINX `server_name` (ENV: `PROXY_SERVER_NAME`) directive and the `CN` field in the SSL certificate have been both set to 'localhost'. This should obviously not be used for production.
The nginx Docker Compose configuration ([`docker-compose.nginx.yml`](/docker-compose.nginx.yml)) uses an NGINX image as the front-end (ie: reverse proxy). It includes HTTPS running on port number 8443 and an HTTP port (81). A "self-signed" SSL certificate is generated beforehand and the server certificate and key files are included. The NGINX `server_name` directive and the `CN` field in the SSL certificate have been both set to 'localhost'. This should obviously not be used for production.
The proxy locations, ports and other NGINX options can be modified in the `.env` file:
```ini
# Host Ports
NGINX_PORT_HOST=81
NGINX_SSLPORT_HOST=8443
# NGINX
NGINX_PORT=80
NGINX_SSLPORT=443
NGINX_LOG_DIR=/var/log/nginx
# Check CKAN__ROOT_PATH and CKANEXT__DCAT__BASE_URI. If you don't need to use domain locations, it is better to use the nginx configuration. Leave blank or use the root `/`.
PROXY_SERVER_NAME=192.168.68.106
PROXY_CKAN_LOCATION=/catalog
PROXY_PYCSW_LOCATION=/csw
```
Creating the SSL cert and key files as follows:
`openssl req -new -newkey rsa:4096 -days 365 -nodes -x509 -subj "/C=DE/ST=Berlin/L=Berlin/O=None/CN=localhost" -keyout ckan-local.key -out ckan-local.crt`
The `ckan-local.*` files will then need to be moved into the nginx/setup/ directory
### Apache HTTP Server
The Docker Compose configuration ([`docker-compose.apache.yml`](/docker-compose.apache.yml)) uses an httpd image as the front-end. It has two routes for the ckan (default location: `/catalog`) and ckan-pycsw (default location: `/csw`) services.
The proxy locations, ports and other Apache Web Server options can be modified in the `.env` file:
```ini
# Host Ports
APACHE_PORT_HOST=81
# Apache HTTP Server
APACHE_VERSION=2.4-alpine
APACHE_PORT=80
APACHE_LOG_DIR=/var/log/apache
# Check CKAN__ROOT_PATH and CKANEXT__DCAT__BASE_URI. If you don't need to use domain locations, it is better to use the nginx configuration. Leave blank or use the root `/`.
PROXY_SERVER_NAME=192.168.68.106
PROXY_CKAN_LOCATION=/catalog
PROXY_PYCSW_LOCATION=/csw
```
### envvars
The ckanext-envvars extension is used in the CKAN Docker base repo to build the base images.
This extension checks for environmental variables conforming to an expected format and updates the corresponding CKAN config settings with its value.

View File

@ -8,12 +8,12 @@ ENV APACHE_PORT=80
ENV APACHE_LOG_DIR=/var/log/apache
ENV APACHE_ROOT=/usr/local/apache2
ENV APACHE_DOCUMENT_ROOT=${APACHE_ROOT}/htdocs
ENV APACHE_SERVER_NAME=localhost
ENV PROXY_SERVER_NAME=localhost
ENV APACHE_CKAN_LOCATION=/
ENV APACHE_PYCSW_LOCATION=/csw
ENV APACHE_PYCSW_PROXY_PASS=http://${PYCSW_CONTAINER_NAME}:${PYCSW_PORT_HOST}
ENV APACHE_CKAN_PROXY_PASS=http://${CKAN_CONTAINER_NAME}:${CKAN_PORT_HOST}
ENV PROXY_CKAN_LOCATION=/catalog
ENV PROXY_PYCSW_LOCATION=/csw
ENV PROXY_PYCSW_PROXY_PASS=http://${PYCSW_CONTAINER_NAME}:${PYCSW_PORT_HOST}
ENV PROXY_CKAN_PROXY_PASS=http://${CKAN_CONTAINER_NAME}:${CKAN_PORT_HOST}
RUN mkdir -p ${APACHE_LOG_DIR}

View File

@ -224,18 +224,18 @@ Group www-data
# virtual host being defined.
#
<VirtualHost *:${APACHE_PORT}>
<Location ${APACHE_CKAN_LOCATION}>
ProxyPass ${APACHE_CKAN_PROXY_PASS}
ProxyPassReverse ${APACHE_CKAN_PROXY_PASS}
<Location ${PROXY_CKAN_LOCATION}>
ProxyPass ${PROXY_CKAN_PROXY_PASS}
ProxyPassReverse ${PROXY_CKAN_PROXY_PASS}
</Location>
<Location ${APACHE_PYCSW_LOCATION}>
ProxyPass ${APACHE_PYCSW_PROXY_PASS}
ProxyPassReverse ${APACHE_PYCSW_PROXY_PASS}
<Location ${PROXY_PYCSW_LOCATION}>
ProxyPass ${PROXY_PYCSW_PROXY_PASS}
ProxyPassReverse ${PROXY_PYCSW_PROXY_PASS}
</Location>
Protocols h2 http/1.1
ServerName ${APACHE_SERVER_NAME}
ServerName ${PROXY_SERVER_NAME}
ServerAdmin webmaster@localhost
DocumentRoot ${APACHE_DOCUMENT_ROOT}
ErrorLog ${APACHE_LOG_DIR}/error.log

View File

@ -52,7 +52,7 @@ RUN echo ${TZ} > /etc/timezone && \
# Used to configure the container environment by setting environment variables, creating users, running initialization scripts, .etc
COPY docker-entrypoint.d/* /docker-entrypoint.d/
# Update who.ini with APACHE_CKAN_LOCATION
# Update who.ini with PROXY_CKAN_LOCATION
COPY setup/who.ini ${APP_DIR}/
# Apply any patches needed to CKAN core

View File

@ -48,7 +48,7 @@ RUN echo ${TZ} > /etc/timezone && \
# Used to configure the container environment by setting environment variables, creating users, running initialization scripts, .etc
COPY docker-entrypoint.d/* /docker-entrypoint.d/
# Update who.ini with APACHE_CKAN_LOCATION
# Update who.ini with PROXY_CKAN_LOCATION
COPY setup/who.ini ${APP_DIR}/
# Override start_ckan.sh with DEV sh

View File

@ -13,7 +13,7 @@ RUN if ! [ /usr/share/zoneinfo/${TZ} -ef /etc/localtime ]; then \
# Used to configure the container environment by setting environment variables, creating users, running initialization scripts, .etc
COPY docker-entrypoint.d/* /docker-entrypoint.d/
# Update who.ini with APACHE_CKAN_LOCATION
# Update who.ini with PROXY_CKAN_LOCATION
COPY setup/who.ini ${APP_DIR}/
# Apply any patches needed to CKAN core

View File

@ -1,9 +1,15 @@
#!/bin/bash
# Update who.ini when exists APACHE_CKAN_LOCATION
# Update who.ini when exists PROXY_CKAN_LOCATION
echo "Update who.ini"
if [ -n "$APACHE_CKAN_LOCATION" ] && [ "$APACHE_CKAN_LOCATION" != "/" ]; then \
sed -i "s|\${WHO_LOCATION}|$APACHE_CKAN_LOCATION|g" ${APP_DIR}/who.ini; \
else \
sed -i "s|\${WHO_LOCATION}|/|g" ${APP_DIR}/who.ini; \
fi
if [ -n "$PROXY_CKAN_LOCATION" ] && [ "$PROXY_CKAN_LOCATION" != "/" ]; then
sed -i "s|\${WHO_LOCATION}|$PROXY_CKAN_LOCATION|g" "${APP_DIR}/who.ini";
else
# Check if the value is exactly "/"
if [ "$PROXY_CKAN_LOCATION" = "/" ]; then
sed -i "s|\${WHO_LOCATION}||g" "${APP_DIR}/who.ini";
else
# Handle the case when $PROXY_CKAN_LOCATION is empty or not set
sed -i "s|\${WHO_LOCATION}|/|g" "${APP_DIR}/who.ini";
fi
fi

View File

@ -1,4 +1,3 @@
# With NGINX and without ckan-pycsw
version: "3"
volumes:
@ -7,11 +6,11 @@ volumes:
solr_data:
services:
nginx:
container_name: ${NGINX_CONTAINER_NAME}
apache:
container_name: ${APACHE_CONTAINER_NAME}
build:
context: nginx/
context: apache/
dockerfile: Dockerfile
env_file:
- .env
@ -24,9 +23,9 @@ services:
ckan:
condition: service_healthy
ports:
- "0.0.0.0:${NGINX_PORT_HOST}:${NGINX_PORT}"
- "0.0.0.0:${NGINX_SSLPORT_HOST}:${NGINX_SSLPORT}"
- "0.0.0.0:${APACHE_PORT_HOST}:${APACHE_PORT}"
restart: on-failure:3
ckan:
container_name: ${CKAN_CONTAINER_NAME}
build:
@ -52,8 +51,32 @@ services:
- ckan_storage:/var/lib/ckan
restart: unless-stopped
healthcheck:
test: ["CMD", "wget", "-qO", "/dev/null", "http://localhost:5000"]
test: ["CMD", "wget", "-qO", "/dev/null", "http://localhost:${CKAN_PORT}"]
pycsw:
container_name: ${PYCSW_CONTAINER_NAME}
build:
context: ckan-pycsw/
dockerfile: Dockerfile
env_file:
- .env
logging:
driver: "json-file"
options:
max-size: "100m"
max-file: "10"
depends_on:
ckan:
condition: service_healthy
ports:
- "0.0.0.0:${PYCSW_PORT_HOST}:${PYCSW_PORT}"
volumes:
- ./log:${APP_DIR}/log
- ./metadata:${APP_DIR}/metadata
restart: on-failure:3
healthcheck:
test: ["CMD", "wget", "-qO", "/dev/null", "http://localhost:${PYCSW_PORT}"]
db:
container_name: ${POSTGRESQL_CONTAINER_NAME}
build:
@ -65,13 +88,13 @@ services:
- DATASTORE_READONLY_PASSWORD=${DATASTORE_READONLY_PASSWORD}
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
- PGDATA=/var/lib/postgresql/data/db
volumes:
- pg_data:/var/lib/postgresql/data
logging:
driver: "json-file"
options:
max-size: "100m"
max-file: "10"
volumes:
- pg_data:/var/lib/postgresql/data
restart: unless-stopped
healthcheck:
test: ["CMD", "pg_isready", "-U", "ckan"]

View File

@ -6,11 +6,10 @@ volumes:
solr_data:
services:
apache:
container_name: ${APACHE_CONTAINER_NAME}
nginx:
container_name: ${NGINX_CONTAINER_NAME}
build:
context: apache/
context: nginx/
dockerfile: Dockerfile
env_file:
- .env
@ -23,9 +22,9 @@ services:
ckan:
condition: service_healthy
ports:
- "0.0.0.0:${APACHE_PORT_HOST}:${APACHE_PORT}"
restart: on-failure:3
- "0.0.0.0:${NGINX_PORT_HOST}:${NGINX_PORT}"
- "0.0.0.0:${NGINX_SSLPORT_HOST}:${NGINX_SSLPORT}"
ckan:
container_name: ${CKAN_CONTAINER_NAME}
build:
@ -76,7 +75,7 @@ services:
restart: on-failure:3
healthcheck:
test: ["CMD", "wget", "-qO", "/dev/null", "http://localhost:${PYCSW_PORT}"]
db:
container_name: ${POSTGRESQL_CONTAINER_NAME}
build:

View File

@ -6,11 +6,10 @@ volumes:
solr_data:
services:
apache:
container_name: ${APACHE_CONTAINER_NAME}
nginx:
container_name: ${NGINX_CONTAINER_NAME}
build:
context: apache/
context: nginx/
dockerfile: Dockerfile
env_file:
- .env
@ -23,9 +22,9 @@ services:
ckan:
condition: service_healthy
ports:
- "0.0.0.0:${APACHE_PORT_HOST}:${APACHE_PORT}"
restart: on-failure:3
- "0.0.0.0:${NGINX_PORT_HOST}:${NGINX_PORT}"
- "0.0.0.0:${NGINX_SSLPORT_HOST}:${NGINX_SSLPORT}"
ckan:
container_name: ${CKAN_CONTAINER_NAME}
build:
@ -76,7 +75,7 @@ services:
restart: on-failure:3
healthcheck:
test: ["CMD", "wget", "-qO", "/dev/null", "http://localhost:${PYCSW_PORT}"]
db:
container_name: ${POSTGRESQL_CONTAINER_NAME}
build:

View File

@ -1,11 +1,24 @@
FROM nginx:stable-alpine
ENV NGINX_DIR=/etc/nginx
ENV CKAN_PORT_HOST=5000
ENV PYCSW_PORT_HOST=8000
ENV PYCSW_CONTAINER_NAME=pycsw
ENV CKAN_CONTAINER_NAME=ckan
ENV PROXY_SERVER_NAME=localhost
ENV PROXY_CKAN_LOCATION=/catalog
ENV PROXY_PYCSW_LOCATION=/csw
ENV PROXY_PYCSW_PROXY_PASS=http://${PYCSW_CONTAINER_NAME}:${PYCSW_PORT_HOST}
ENV PROXY_CKAN_PROXY_PASS=http://${CKAN_CONTAINER_NAME}:${CKAN_PORT_HOST}
ENV NGINX_PORT=80
ENV NGINX_LOG_DIR=/var/log/nginx
ENV NGINX_DIR=/etc/nginx
RUN mkdir -p ${NGINX_LOG_DIR}
COPY setup/nginx.conf ${NGINX_DIR}/nginx.conf
COPY setup/index.html /usr/share/nginx/html/index.html
COPY setup/default.conf ${NGINX_DIR}/conf.d/
COPY setup/default.conf.template ${NGINX_DIR}/templates/default.conf.templateç
RUN mkdir -p ${NGINX_DIR}/certs
COPY setup/ckan-local.* ${NGINX_DIR}/certs/

View File

@ -1,30 +1,32 @@
-----BEGIN CERTIFICATE-----
MIIFIDCCAwgCCQDr3dGZoSvqMDANBgkqhkiG9w0BAQsFADBSMQswCQY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ll9TwqSWzBaHCV+idKW2WXCXQsCvZtyurvW153UZ36fCTE9
8fmbx3d2TUnRr8JFrshExjFTpu4eMYdoEm0PsGjC3kiA0bhhb9LIdPtxkCunfIQx
HvUCggEBANbj5BOj7XSXU9/3/jaKpWBJYQpCSMwm3uA3YkXzyjdR92n8JVNLQfO+
g0U3mPdCTZdOxwGcrsLSH/+Aq/N6GSjc0uJg7OHiLEfRqhM5OudlsYU9kgRLA9rn
CGUvYvMvhAzjkOV9pabQONWWpNVEsn5sViEb6rHratlVsDiey6mz1D2rwWZN1tJs
Kj9eyrN9WJ5Cp5MSPW3Xh0neFx43STN7ANyndAwPuL/sWTFm6R2pv9b3/VelKYXp
VIRGqBLWXv4m3Jk5f6WaaBIEQwJ5QcCuYhKLNf0nLuc4OFF4l92czxzYsQFOKZRy
iycJUgmdCcBC+PcCS7b6jI+Rp29QaKw=
-----END PRIVATE KEY-----

View File

@ -1,19 +1,28 @@
server {
listen 80;
listen [::]:80;
listen 443 ssl;
listen [::]:443 ssl;
server_name localhost;
listen ${NGINX_PORT};
listen [::]:${NGINX_PORT};
listen ${NGINX_SSLPORT} ssl;
listen [::]:${NGINX_SSLPORT} ssl;
server_name ${PROXY_SERVER_NAME};
ssl_certificate /etc/nginx/certs/ckan-local.crt;
ssl_certificate_key /etc/nginx/certs/ckan-local.key;
#access_log /var/log/nginx/host.access.log main;
location / {
proxy_pass http://ckan:5000/;
location ${PROXY_CKAN_LOCATION} {
proxy_pass ${PROXY_CKAN_PROXY_PASS}/;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header Host $host;
proxy_cache_bypass $cookie_auth_tkt;
proxy_no_cache $cookie_auth_tkt;
proxy_cache_valid 30m;
proxy_cache_key $host$scheme$proxy_host$request_uri;
}
location ${PROXY_PYCSW_LOCATION} {
proxy_pass ${PROXY_PYCSW_PROXY_PASS}/;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header Host $host;
#proxy_cache cache;
proxy_cache_bypass $cookie_auth_tkt;
proxy_no_cache $cookie_auth_tkt;
proxy_cache_valid 30m;

124
samples/.env.apache.example Normal file
View File

@ -0,0 +1,124 @@
# Base
APP_DIR=/srv/app
# Container names
NGINX_CONTAINER_NAME=nginx
REDIS_CONTAINER_NAME=redis
POSTGRESQL_CONTAINER_NAME=db
SOLR_CONTAINER_NAME=solr
CKAN_CONTAINER_NAME=ckan
WORKER_CONTAINER_NAME=ckan-worker
# Host Ports
CKAN_PORT_HOST=5000
NGINX_PORT_HOST=80
NGINX_SSLPORT_HOST=8443
# Solr
SOLR_IMAGE_VERSION=2.9-solr8-spatial
SOLR_PORT=8983
CKAN_SOLR_URL=http://solr:${SOLR_PORT}/solr/ckan
TEST_CKAN_SOLR_URL=http://solr:${SOLR_PORT}/solr/ckan
# Redis
REDIS_VERSION=7-alpine
CKAN_REDIS_URL=redis://redis:6379/1
TEST_CKAN_REDIS_URL=redis://redis:6379/1
# NGINX
NGINX_PORT=80
NGINX_SSLPORT=443
# CKAN databases
POSTGRES_USER=ckan
POSTGRES_PASSWORD=ckan
DATASTORE_READONLY_USER=datastore_ro
DATASTORE_READONLY_PASSWORD=datastore
POSTGRES_HOST=db
CKAN_SQLALCHEMY_URL=postgresql://ckan:ckan@db/ckan
CKAN_DATASTORE_WRITE_URL=postgresql://ckan:ckan@db/datastore
CKAN_DATASTORE_READ_URL=postgresql://datastore_ro:datastore@db/datastore
# Test database connections
TEST_CKAN_SQLALCHEMY_URL=postgres://ckan:ckan@db/ckan_test
TEST_CKAN_DATASTORE_WRITE_URL=postgresql://ckan:ckan@db/datastore_test
TEST_CKAN_DATASTORE_READ_URL=postgresql://datastore_ro:datastore@db/datastore_test
# CKAN core
CKAN_VERSION=2.9.9
CKAN_SITE_ID=default
CKAN_SITE_URL=http://localhost:5000
CKAN_PORT=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_EMAIL=your_email@example.com
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
TZ=UTC
## Customize which text formats the text_view plugin will show
CKAN__PREVIEW__JSON_FORMATS="json jsonld"
# html htm rdf+xml owl+xml xml n3 n-triples turtle plain atom csv tsv rss txt json
CKAN__PREVIEW__XML_FORMATS="xml rdf rdf+xml owl+xml atom rss turtle ttl n3 n-triples"
CKAN__PREVIEW__TEXT_FORMATS="text plain text/plain text/turtle csv tsv rss txt json"
CKAN__PREVIEW__LOADABLE="html htm rdf+xml owl+xml xml n3 n-triples turtle plain atom csv tsv rss txt json arcgis_rest"
## Resource Proxy settings
### Preview size limit, default: 1MB
CKAN__RESOURCE_PROXY__MAX_FILE_SIZE=50048576
## Size of chunks to read/write__
CKAN__RESOURCE_PROXY__CHUNK_SIZE=4096
## Default timeout for fetching proxied items
CKAN__RESOURCE_PROXY__TIMEOUT=10
CKAN__VIEWS__DEFAULT_VIEWS="image_view webpage_view text_view recline_view wmts_view geojson_view geo_view shp_view pdf_view"
# Localization
CKAN__LOCALE_DEFAULT="en"
CKAN__LOCALE_ORDER="en es pt_BR ja it cs_CZ ca fr el sv sr sr@latin no sk fi ru de pl nl bg ko_KR hu sa sl lv"
# Extensions
CKAN__PLUGINS="envvars stats text_view image_view webpage_view recline_view resourcedictionary datastore xloader harvest ckan_harvester spatial_metadata spatial_query spatial_harvest_metadata_api csw_harvester waf_harvester doc_harvester resource_proxy geo_view geojson_view wmts_view shp_view dcat dcat_rdf_harvester dcat_json_harvester dcat_json_interface scheming_datasets scheming_groups scheming_organizations pdf_view pages"
# ckanext-harvest
CKAN__HARVEST__MQ__TYPE=redis
CKAN__HARVEST__MQ__HOSTNAME=redis
CKAN__HARVEST__MQ__PORT=6379
CKAN__HARVEST__MQ__REDIS_DB=1
# ckanext-xloader
CKANEXT__XLOADER__API_TOKEN=api_token
CKANEXT__XLOADER__JOBS__DB_URI=postgresql://ckan:ckan@db/ckan
# ckanext-dcat
CKANEXT__DCAT__BASE_URI=https://localhost:5000/
CKANEXT__DCAT__RDF_PROFILES="euro_dcat_ap_2 euro_dcat_ap"
# ckanext-scheming: setup_scheming.sh
SCHEMA_CKANEXT_SCHEMING_DATASET_SCHEMA="ckanext.scheming:ckan_geodcatap.yaml"
SCHEMA_CKANEXT_SCHEMING_GROUP_SCHEMAS="ckanext.scheming:ckan_group_geodcatap.json"
SCHEMA_CKANEXT_SCHEMING_ORGANIZATION_SCHEMAS="ckanext.scheming:ckan_org_geodcatap.json"
SCHEMA_CKANEXT_SCHEMING_PRESETS="ckanext.scheming:presets.json"
# ckanext-spatial (Solr Backend - solr8-spatial)
CKANEXT__SPATIAL__SEARCH_BACKEND=solr-bbox
CKAN__SPATIAL__SRID=3857
CKANEXT__SPATIAL__COMMON_MAP__TYPE=custom
CKANEXT__SPATIAL__COMMON_MAP__CUSTOM__URL=https://rts.larioja.org/mapa-base/rioja/{z}/{x}/{y}.png
CKANEXT__SPATIAL__COMMON_MAP__ATTRIBUTION='Servicios de Teselas. <a href="https://www.idee.es/">IDEE</a>, bajo <a href="http://creativecommons.org/licenses/by/3.0">CC BY 3.0</a>.'
# ckanext-geoview
CKANEXT__GEOVIEW__GEOJSON__MAX_FILE_SIZE=100000000
CKANEXT__GEOVIEW__OL_VIEWER__FORMATS="wms wfs geojson gml kml"
CKANEXT__GEOVIEW__SHP_VIEWER__SRID=3857
CKANEXT__GEOVIEW__SHP_VIEWER__ENCODING=UTF-8
#TODO: ckanext-sparql - Not implemented yet
CKANEXT__SPARQL__ENDPOINT_URL=http://dbpedia.org/sparql
CKANEXT__SPARQL__HIDE_ENDPOINT_URL=False

View File

@ -37,10 +37,10 @@ NGINX_SSLPORT=443
APACHE_VERSION=2.4-alpine
APACHE_PORT=80
APACHE_LOG_DIR=/var/log/apache
APACHE_SERVER_NAME=localhost
PROXY_SERVER_NAME=localhost
# Check CKAN__ROOT_PATH and CKANEXT__DCAT__BASE_URI. If you don't need to use domain locations, it is better to use the nginx configuration.
APACHE_CKAN_LOCATION=/catalog
APACHE_PYCSW_LOCATION=/csw
PROXY_CKAN_LOCATION=/catalogcatalog
PROXY_PYCSW_LOCATION=/csw
# pycsw
PYCSW_PORT=8000