diff --git a/.gitignore b/.gitignore index 79908eb3..ccbecec6 100644 --- a/.gitignore +++ b/.gitignore @@ -6,3 +6,4 @@ logs/ venv-dbt/ .venv/ .user.yml +dbt_packages diff --git a/.kubernetes/deployment.yaml b/.kubernetes/deployment.yaml index ef5685a0..ab4e0932 100644 --- a/.kubernetes/deployment.yaml +++ b/.kubernetes/deployment.yaml @@ -30,7 +30,11 @@ spec: - name: credentials-prod mountPath: /credentials-prod/ readOnly: true - command: + command: + - "/bin/sh" + - "-c" + args: + - "dbt deps;" - "dbt-rpc" - "serve" - "--profiles-dir" @@ -84,7 +88,11 @@ spec: - name: credentials-prod mountPath: /credentials-prod/ readOnly: true - command: + command: + - "/bin/sh" + - "-c" + args: + - "dbt deps;" - "dbt-rpc" - "serve" - "--profiles-dir" diff --git a/Dockerfile b/Dockerfile index 99f5d11f..e1f199e8 100644 --- a/Dockerfile +++ b/Dockerfile @@ -14,5 +14,5 @@ RUN pip install --no-cache-dir -r requirements.txt && rm requirements.txt WORKDIR /dbt COPY . . -# Run dbt rpc -CMD ["dbt-rpc", "serve", "--profiles-dir", ".", "--host", "0.0.0.0", "--port", "8580"] +# Run dbt deps and dbt rpc +CMD ["/dbt/start-server.sh"] diff --git a/packages.yml b/packages.yml new file mode 100644 index 00000000..60f8dfb7 --- /dev/null +++ b/packages.yml @@ -0,0 +1,3 @@ +packages: + - package: dbt-labs/dbt_utils + version: 1.1.1 diff --git a/start-server.sh b/start-server.sh new file mode 100755 index 00000000..ea2a6a74 --- /dev/null +++ b/start-server.sh @@ -0,0 +1,4 @@ +#!/usr/bin/env sh + +dbt deps +dbt-rpc serve --profiles-dir "." --host "0.0.0.0" --port "8580"