From fefadda8e2f04bb3ac830001a0a99252cf5239c4 Mon Sep 17 00:00:00 2001 From: mjanez <96422458+mjanez@users.noreply.github.com> Date: Fri, 8 Nov 2024 14:43:46 +0100 Subject: [PATCH] Add build arguments for CKAN and PyCSW locations for nginx service --- docker-compose.dev.yml | 3 +++ docker-compose.ghcr.yml | 7 +++++-- docker-compose.yml | 3 +++ nginx/Dockerfile | 7 ++++--- nginx/setup/html/github.svg | 1 - 5 files changed, 15 insertions(+), 6 deletions(-) delete mode 100644 nginx/setup/html/github.svg diff --git a/docker-compose.dev.yml b/docker-compose.dev.yml index d36fb40a..8e09d288 100644 --- a/docker-compose.dev.yml +++ b/docker-compose.dev.yml @@ -13,6 +13,9 @@ services: build: context: nginx/ dockerfile: Dockerfile + args: + PROXY_CKAN_LOCATION: ${PROXY_CKAN_LOCATION} + PROXY_PYCSW_LOCATION: ${PROXY_PYCSW_LOCATION} env_file: - .env environment: diff --git a/docker-compose.ghcr.yml b/docker-compose.ghcr.yml index e96b1f6f..0988e2fe 100644 --- a/docker-compose.ghcr.yml +++ b/docker-compose.ghcr.yml @@ -12,13 +12,16 @@ services: build: context: nginx/ dockerfile: Dockerfile + args: + PROXY_CKAN_LOCATION: ${PROXY_CKAN_LOCATION} + PROXY_PYCSW_LOCATION: ${PROXY_PYCSW_LOCATION} env_file: - .env logging: driver: "json-file" options: - max-size: "100m" - max-file: "10" + max-size: "100m" + max-file: "10" networks: - webnet - ckannet diff --git a/docker-compose.yml b/docker-compose.yml index f4e1b2a7..49cac765 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -12,6 +12,9 @@ services: build: context: nginx/ dockerfile: Dockerfile + args: + PROXY_CKAN_LOCATION: ${PROXY_CKAN_LOCATION} + PROXY_PYCSW_LOCATION: ${PROXY_PYCSW_LOCATION} env_file: - .env logging: diff --git a/nginx/Dockerfile b/nginx/Dockerfile index c66209c9..2d436314 100644 --- a/nginx/Dockerfile +++ b/nginx/Dockerfile @@ -1,12 +1,13 @@ FROM nginx:stable-alpine +ARG PROXY_CKAN_LOCATION=/catalog +ARG PROXY_PYCSW_LOCATION=/csw + ENV CKAN_PORT=5000 ENV PYCSW_PORT=8000 ENV PYCSW_COMPOSE_SERVICE=pycsw ENV CKAN_COMPOSE_SERVICE=ckan ENV PROXY_SERVER_NAME=localhost -ENV PROXY_CKAN_LOCATION=/catalog -ENV PROXY_PYCSW_LOCATION=/csw ENV PROXY_PYCSW_PROXY_PASS=http://${PYCSW_COMPOSE_SERVICE}:${PYCSW_PORT} ENV PROXY_CKAN_PROXY_PASS=http://${CKAN_COMPOSE_SERVICE}:${CKAN_PORT} @@ -25,6 +26,6 @@ COPY setup/ckan-local.* ${NGINX_DIR}/certs/ COPY setup/html/index.html setup/html/robots.txt ${NGINX_SHARE_HTML_DIR}/ # Replace $PROXY_CKAN_LOCATION and $PROXY_PYCSW_LOCATION in index.html -RUN sed -i "s|/catalog|${PROXY_CKAN_LOCATION}|g; s|/csw|${PROXY_PYCSW_LOCATION}|g" ${NGINX_SHARE_HTML_DIR}/index.html +RUN sed -i "s|||g; s|||g" ${NGINX_SHARE_HTML_DIR}/index.html EXPOSE ${NGINX_PORT} \ No newline at end of file diff --git a/nginx/setup/html/github.svg b/nginx/setup/html/github.svg deleted file mode 100644 index a3ff759d..00000000 --- a/nginx/setup/html/github.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file