Fix duplicate entry and add mail schema init
This commit is contained in:
parent
b276174405
commit
85df924c21
|
@ -13,7 +13,7 @@ RUN ./postgres-seeder \
|
|||
"gitea/gitea" \
|
||||
"murmur/murmur" \
|
||||
"postfix/mail" \
|
||||
"postfix/mail"
|
||||
"dovecot/mail"
|
||||
# Spits out init.sql and pg_hba.conf
|
||||
|
||||
FROM postgres:alpine
|
||||
|
@ -33,6 +33,7 @@ RUN chown -Rv postgres:postgres /etc/redxen/postgres-cert/
|
|||
ADD postgresql.conf /etc/postgresql/postgresql.conf
|
||||
COPY --from=init /root/pg_hba.conf /etc/postgresql/pg_hba.conf
|
||||
COPY --from=init /root/init.sql /docker-entrypoint-initdb.d/init.sql
|
||||
ADD databases/mail.sql /docker-entrypoint-initdb.d/mail.sql
|
||||
|
||||
# TODO: https://hub.docker.com/_/postgres > Initialisation scripts (Database)
|
||||
CMD ["postgres", "-c", "config_file=/etc/postgresql/postgresql.conf"]
|
||||
|
|
|
@ -0,0 +1,16 @@
|
|||
CREATE TABLE users (
|
||||
userid VARCHAR(128) NOT NULL,
|
||||
password TEXT NOT NULL,
|
||||
active BOOLEAN NOT NULL DEFAULT true,
|
||||
PRIMARY KEY (userid),
|
||||
UNIQUE (userid)
|
||||
);
|
||||
CREATE TABLE aliases (
|
||||
target VARCHAR(128) NOT NULL,
|
||||
alias VARCHAR(128) NOT NULL,
|
||||
active BOOLEAN NOT NULL DEFAULT true,
|
||||
PRIMARY KEY (alias),
|
||||
UNIQUE (alias)
|
||||
);
|
||||
GRANT SELECT ON TABLE users TO dovecot;
|
||||
GRANT SELECT ON TABLE users, aliases TO postfix;
|
Loading…
Reference in New Issue