forked from osdldbt/dbt2
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile.database
More file actions
38 lines (26 loc) · 970 Bytes
/
Dockerfile.database
File metadata and controls
38 lines (26 loc) · 970 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
From dbt2-base
ARG PGVERSION
ENV PATH="/usr/pgsql-${PGVERSION}/bin:$PATH"
RUN dnf -y install postgresql${PGVERSION}-server
COPY . /usr/local/src/dbt2
ARG dbms=pgsql
# Install DBT-2 for PostgreSQL.
WORKDIR /usr/local/src/dbt2
ENV DBMS="$dbms"
RUN make release
RUN (cd builds/release && make install)
# Install DBT-2 PostgreSQL user defined C functions.
WORKDIR /usr/local/src/dbt2/storedproc/pgsql/c
RUN if [ "x$dbms" = "xpgsql" ]; then make USE_PGXS=1 install; fi
RUN chmod 777 /opt
USER postgres
ENV DBT2DBNAME="dbt2"
ENV DBT2PGDATA="/opt/pgdata"
ENV PGHOST="/tmp"
ARG warehouses=1
WORKDIR /tmp
RUN if [ "x$dbms" = "xpgsql" ]; then dbt2-pgsql-build-db -w $warehouses \
-- -p "-c unix_socket_directories='/tmp'" && \
dbt2-pgsql-stop-db; fi
RUN if [ "x$dbms" = "xpgsql" ]; then echo "host all all 0.0.0.0/0 trust" >> /opt/pgdata/pg_hba.conf; fi
RUN if [ "x$dbms" = "xpgsql" ]; then echo "host all all ::/0 trust" >> /opt/pgdata/pg_hba.conf; fi