mirror of
https://github.com/eftechcombr/bacula.git
synced 2025-06-27 16:46:54 +00:00
33 lines
1.0 KiB
Docker
33 lines
1.0 KiB
Docker
FROM eftechcombr/bacula:13.0.3-base AS base
|
|
|
|
FROM postgres:13.7
|
|
|
|
ENV POSTGRES_PASSWORD bacula
|
|
|
|
ENV POSTGRES_USER bacula
|
|
|
|
ENV POSTGRES_DB bacula
|
|
|
|
ENV POSTGRES_INITDB_ARGS '--encoding=SQL_ASCII --lc-collate=C --lc-ctype=C'
|
|
|
|
COPY --from=base /opt/bacula/scripts/make_postgresql_tables /docker-entrypoint-initdb.d/make_postgresql_tables
|
|
|
|
COPY --from=base /opt/bacula/scripts/grant_postgresql_privileges /docker-entrypoint-initdb.d/grant_postgresql_privileges
|
|
|
|
RUN { \
|
|
echo '#!/bin/bash'; \
|
|
echo 'sh /docker-entrypoint-initdb.d/make_postgresql_tables --username=$POSTGRES_USER'; \
|
|
echo 'sh /docker-entrypoint-initdb.d/grant_postgresql_privileges --username=$POSTGRES_USER'; \
|
|
} >> /docker-entrypoint-initdb.d/deploy_database.sh \
|
|
&& chmod +x /docker-entrypoint-initdb.d/deploy_database.sh \
|
|
&& chown postgres. /docker-entrypoint-initdb.d/deploy_database.sh
|
|
|
|
# COPY 01-make_postgresql_tables.sql 02-grant_postgresql_privileges.sql /docker-entrypoint-initdb.d/
|
|
|
|
RUN chown -R postgres. /docker-entrypoint-initdb.d/*
|
|
|
|
VOLUME ["/var/lib/postgresql/data"]
|
|
|
|
EXPOSE 5432/tcp
|
|
|