-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
39 lines (30 loc) · 982 Bytes
/
Copy pathDockerfile
File metadata and controls
39 lines (30 loc) · 982 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
39
FROM docker-remote.jfrog.booking.com/python:3.11-slim
# Add system packages that might be useful for dbt and general development
RUN apt-get update \
&& apt-get install -y \
git \
bash-completion \
build-essential \
curl \
ca-certificates \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
# Set the working directory inside the container
WORKDIR /app
# Install Python dependencies
COPY requirements.txt .
RUN pip install --upgrade pip
RUN pip install --no-cache-dir -r requirements.txt
# Copy the entire project
COPY . .
# Create non-root user for better security
RUN useradd -m -s /bin/bash dbtuser
# Set the dbt profiles directory to our dbt_project subfolder
ENV DBT_PROFILES_DIR=/app/dbt_project
# Fix permissions for the non-root user
RUN chown -R dbtuser:dbtuser /app
RUN chmod -R 755 /app
# Switch to non-root user
USER dbtuser
# Set the working directory to dbt_project for dbt commands
WORKDIR /app/dbt_project