-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathContainerfile.database
36 lines (27 loc) · 1.16 KB
/
Containerfile.database
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
From dbt2-base
ARG dbms=pgsql
# 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"
ARG warehouses=1
# Make sure we are in a directory we can write to.
WORKDIR /home/postgres
RUN if [ "x$dbms" = "xpgsql" ]; then \
dbt2-pgsql-build-db -u -p "-N 500" -s c -w $warehouses && \
dbt2-pgsql-stop-db && \
echo "host all all 0.0.0.0/0 trust" >> /opt/pgdata/pg_hba.conf && \
echo "host all all 0.0.0.0/0 trust" >> /opt/pgdata/pg_hba.conf && \
echo "host all all ::/0 trust" >> /opt/pgdata/pg_hba.conf && \
echo "DBT2DBNAME=dbt2" >> ~/.ssh/environment && \
echo "DBT2PGDATA=/opt/pgdata" >> ~/.ssh/environment && \
echo "listen_addresses = '*'" >> /opt/pgdata/postgresql.auto.conf && \
echo "max_connections = '500'" >> /opt/pgdata/postgresql.auto.conf; \
fi
USER root
RUN echo "PermitUserEnvironment yes" >> /etc/ssh/sshd_config
RUN systemctl enable sshd
CMD [ "/usr/sbin/init" ]