Skip to content

Commit

Permalink
Add build arguments for CKAN and PyCSW locations for nginx service
Browse files Browse the repository at this point in the history
  • Loading branch information
mjanez committed Nov 8, 2024
1 parent a51bcca commit fefadda
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 6 deletions.
3 changes: 3 additions & 0 deletions docker-compose.dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
7 changes: 5 additions & 2 deletions docker-compose.ghcr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 3 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
7 changes: 4 additions & 3 deletions nginx/Dockerfile
Original file line number Diff line number Diff line change
@@ -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}

Expand All @@ -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|<a href=\"/catalog\">|<a href=\"${PROXY_CKAN_LOCATION}\">|g; s|<a href=\"/csw\">|<a href=\"${PROXY_PYCSW_LOCATION}\">|g" ${NGINX_SHARE_HTML_DIR}/index.html

EXPOSE ${NGINX_PORT}
1 change: 0 additions & 1 deletion nginx/setup/html/github.svg

This file was deleted.

0 comments on commit fefadda

Please sign in to comment.