commit postgresql directory changes

This commit is contained in:
Brett 2021-10-29 13:58:24 +02:00
parent bfb4c475e6
commit 0d7e4d8f09
3 changed files with 16 additions and 12 deletions

View File

@ -1,15 +1,13 @@
FROM nginx:1.19.8-alpine FROM postgres:12-alpine
ENV NGINX_DIR=/etc/nginx # Allow connections; we don't map out any ports so only linked docker containers can connect
RUN echo "host all all 0.0.0.0/0 md5" >> /var/lib/postgresql/data/pg_hba.conf
COPY index.html /usr/share/nginx/html/index.html # Customize default user/pass/db
ENV POSTGRES_DB ckan
ENV POSTGRES_USER ckan
ARG POSTGRES_PASSWORD
ARG DATASTORE_READONLY_PASSWORD
RUN mkdir -p ${NGINX_DIR}/sites-available # Include datastore setup scripts
RUN mkdir -p ${NGINX_DIR}/sites-enabled COPY ./postgresql/docker-entrypoint-initdb.d /docker-entrypoint-initdb.d
COPY setup/nginx.conf ${NGINX_DIR}
COPY setup/sites-available/* ${NGINX_DIR}/sites-available
RUN ln -s ${NGINX_DIR}/sites-available/ckan.conf ${NGINX_DIR}/sites-enabled/ckan.conf
EXPOSE 80

View File

@ -0,0 +1,4 @@
\set datastore_ro_password '\'' `echo $DATASTORE_READONLY_PASSWORD` '\''
CREATE ROLE datastore_ro NOSUPERUSER NOCREATEDB NOCREATEROLE LOGIN PASSWORD :datastore_ro_password;
CREATE DATABASE datastore OWNER ckan ENCODING 'utf-8';

View File

@ -0,0 +1,2 @@
CREATE DATABASE ckan_test OWNER ckan ENCODING 'utf-8';
CREATE DATABASE datastore_test OWNER ckan ENCODING 'utf-8';