Skip to content

k-hui/dbt-docker-container

Repository files navigation

dbt-docker-container

DBT docker container with Python FastAPI

Requirements

Getting Started

Initialize Python Environment

python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt

Step by Step Development

Setup server and database in container

# setup containers
docker-compose up -d
# remove contaners
docker-compose down

Install dbt-core & database adapter (postgres)

pip install dbt-postgres

Initialize dbt project

# initialize dbt project
dbt init example
# clone the profiles.yml to local project
cp ~/.dbt/profiles.yml ./example
# debug
dbt debug --project-dir example --profiles-dir example
# test dbt run
dbt run --project-dir example --profiles-dir example

Install FastAPI

pip install fastapi
pip install "uvicorn[standard]"

Start local server in host (not docker container)

sh run-start.sh

Testing

sh run-dbt-debug.sh
sh run-dbt-run.sh

About

DBT docker container

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors