docker-ckan/nginx/Dockerfile

35 lines
1.1 KiB
Docker
Raw Normal View History

2022-07-11 13:32:17 +02:00
FROM nginx:stable-alpine
2020-09-17 11:42:27 +02:00
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} && \
mkdir -p ${NGINX_DIR}/certs && \
apk update --no-cache && \
2023-06-02 10:34:36 +02:00
apk upgrade --no-cache && \
apk add --no-cache openssl
2020-09-17 11:42:27 +02:00
2022-07-20 14:41:52 +02:00
COPY setup/nginx.conf ${NGINX_DIR}/nginx.conf
2022-07-11 13:32:17 +02:00
COPY setup/index.html /usr/share/nginx/html/index.html
2023-08-09 10:56:39 +02:00
COPY setup/default.conf.template ${NGINX_DIR}/templates/default.conf.template
2022-07-14 11:40:02 +02:00
2023-06-02 10:34:36 +02:00
ENTRYPOINT \
openssl req \
-subj '/C=DE/ST=Berlin/L=Berlin/O=None/CN=${PROXY_SERVER_NAME}' \
2023-06-02 10:34:36 +02:00
-x509 -newkey rsa:4096 \
-nodes -keyout /etc/nginx/ssl/default_key.pem \
-keyout ${NGINX_DIR}/certs/ckan-local.key \
-out ${NGINX_DIR}/certs/ckan-local.crt \
-days 365 && \
nginx -g 'daemon off;'