FROM nginx:stable-alpine ENV NGINX_DIR=/etc/nginx RUN apk update --no-cache && \ apk upgrade --no-cache && \ apk add --no-cache openssl 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/ RUN mkdir -p ${NGINX_DIR}/certs ENTRYPOINT \ openssl req \ -subj '/C=DE/ST=Berlin/L=Berlin/O=None/CN=localhost' \ -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;'