fradrive/docker/database/Dockerfile

22 lines
1.1 KiB
Docker

FROM docker.io/postgres:12
# Allow for connecting to database without password authentication
ENV POSTGRES_HOST_AUTH_METHOD=trust
COPY --chown=postgres:postgres docker/database/pg_hba.conf /tmp/pg_hba.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/initdb.sh /etc/fradrive-db && chmod 755 /etc/fradrive-db
USER postgres
# postgresql.conf and postgres_hba.conf resulted in error (Invalid data directory or sth); using -o/--options in initdb.sh instead
# COPY --chown=postgres:postgres --chmod=644 ./postgresql.conf /etc/postgresql/12/main/postgresql.conf
# COPY --chown=postgres:postgres --chmod=644 ./pg_hba.conf /etc/postgresql/12/main/pg_hba.conf
# ADD ./schema.sql /schema.sql
# ADD --chmod=755 ./initdb.sh /etc/fradrive-db
EXPOSE 5432/tcp