-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathDockerfile
More file actions
36 lines (27 loc) · 1.29 KB
/
Dockerfile
File metadata and controls
36 lines (27 loc) · 1.29 KB
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
# Builder stage
FROM ghcr.io/astral-sh/uv:python3.13-trixie-slim AS builder
WORKDIR /app
COPY uv.lock pyproject.toml README.md ./
RUN --mount=type=cache,target=/root/.cache/uv \
UV_COMPILE_BYTECODE=1 \
uv pip install --system --no-cache .
ADD analyses /dbt/analyses
ADD macros /dbt/macros
ADD models /dbt/models
ADD seeds /dbt/seeds
ADD tests /dbt/tests
ADD dbt_project.yml package-lock.yml packages.yml /dbt/
ADD profiles.tmpl.yml /dbt/profiles.yml
# Runner stage
FROM python:3.13-slim AS runner
WORKDIR /dbt/
COPY --from=builder /usr/local/lib/python3.13/site-packages /usr/local/lib/python3.13/site-packages
COPY --from=builder /usr/local/bin /usr/local/bin
COPY --from=builder /dbt /dbt
ENV DBT_PROFILES_DIR=/dbt/
ENV DBT_REDSHIFT_HOST=
ENV DBT_REDSHIFT_DATABASE=
ENV DBT_REDSHIFT_SCHEMA=
ENV AWS_ACCESS_KEY_ID=
ENV AWS_SECRET_ACCESS_KEY=
ENTRYPOINT ["sh", "-c", "dbt deps && dbt build --target prod && cp target/run_results.json target/run_results_backup.json && dbt docs generate --target prod && cp target/run_results_backup.json target/run_results.json"]