build(docker/database): use postgres-container given .d dir to automatically apply postgres config
This commit is contained in:
parent
09e53fda53
commit
2295f54486
@ -3,11 +3,13 @@ FROM docker.io/postgres:12
|
|||||||
# Allow for connecting to database without password authentication
|
# Allow for connecting to database without password authentication
|
||||||
ENV POSTGRES_HOST_AUTH_METHOD=trust
|
ENV POSTGRES_HOST_AUTH_METHOD=trust
|
||||||
|
|
||||||
RUN cp /mnt/fradrive/docker/database/pg_hba.conf /docker-entrypoint-initdb.d/pg_hba.conf && chown postgres:postgres /docker-entrypoint-initdb.d/pg_hba.conf
|
COPY --chown=postgres:postgres docker/database/pg_hba.conf /tmp/pg_hba.conf
|
||||||
RUN cp /mnt/fradrive/docker/database/postgresql.conf /docker-entrypoint-initdb.d/postgresql.conf && chown postgres:postgres /docker-entrypoint-initdb.d/postgresql.conf
|
COPY --chown=postgres:postgres docker/database/postgresql.conf /tmp/postgresql.conf
|
||||||
|
COPY docker/database/pgconfig.sh /docker-entrypoint-initdb.d/_pgconfig.sh
|
||||||
|
COPY --chown=postgres:postgres docker/database/schema.sql /docker-entrypoint-initdb.d/schema.sql
|
||||||
|
|
||||||
RUN cp /mnt/fradrive/docker/database/schema.sql /schema.sql && chown postgres:postgres /schema.sql
|
# RUN cp /mnt/fradrive/docker/database/schema.sql /schema.sql && chown postgres:postgres /schema.sql
|
||||||
RUN cp /mnt/fradrive/docker/database/initdb.sh /etc/fradrive-db && chmod 755 /etc/fradrive-db
|
# RUN cp /mnt/fradrive/docker/database/initdb.sh /etc/fradrive-db && chmod 755 /etc/fradrive-db
|
||||||
|
|
||||||
USER postgres
|
USER postgres
|
||||||
|
|
||||||
@ -17,5 +19,4 @@ USER postgres
|
|||||||
# ADD ./schema.sql /schema.sql
|
# ADD ./schema.sql /schema.sql
|
||||||
# ADD --chmod=755 ./initdb.sh /etc/fradrive-db
|
# ADD --chmod=755 ./initdb.sh /etc/fradrive-db
|
||||||
|
|
||||||
ENTRYPOINT /etc/fradrive-db
|
|
||||||
EXPOSE 5432/tcp
|
EXPOSE 5432/tcp
|
||||||
6
docker/database/pgconfig.sh
Executable file
6
docker/database/pgconfig.sh
Executable file
@ -0,0 +1,6 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
cat /tmp/pg_hba.conf > /var/lib/postgresql/data/pg_hba.conf
|
||||||
|
cat /tmp/postgresql.conf > /var/lib/postgresql/data/postgresql.conf
|
||||||
|
|
||||||
|
echo "Custom pg_hba.conf and postgresql.conf successfully deployed."
|
||||||
Reference in New Issue
Block a user