-
Notifications
You must be signed in to change notification settings - Fork 13
/
Dockerfile
41 lines (33 loc) · 1.13 KB
/
Dockerfile
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
39
40
41
FROM python:3.9-slim
RUN apt-get update \
&& apt-get install -y \
postgresql-client \
libpq-dev \
git \
bash-completion \
build-essential \
cmake \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
# dbt-runner app
ENV LC_ALL C.UTF-8
ENV LANG C.UTF-8
ENV PYTHONUNBUFFERED 1
ENV PYTHONPATH /dbt-runner
ENV DBT_PROFILES_DIR /dbt-runner/dbt
ENV DBT_MODULES_DIR /dbt_modules
WORKDIR /dbt-runner
# Conveniences
ENV PROMPT_COMMAND history -a
RUN echo 'source /usr/share/bash-completion/bash_completion' >> /etc/bash.bashrc
RUN echo 'export HISTFILE=/dbt-runner/.developer/history' >> $HOME/.bashrc
RUN echo 'mkdir -p /dbt-runner/.developer && touch /dbt-runner/.developer/bashrc && source /dbt-runner/.developer/bashrc' >> $HOME/.bashrc
COPY requirements.txt requirements.txt
RUN pip install --upgrade pip
RUN pip install --ignore-installed -r requirements.txt && rm -rf /root/.cache
RUN mkdir -p /build_dbt_deps
COPY dbt/dbt_project.yml /build_dbt_deps/dbt_project.yml
COPY dbt/packages.yml /build_dbt_deps/packages.yml
RUN cd /build_dbt_deps \
&& dbt deps
ENTRYPOINT ["/bin/bash", "-c"]