Skip to content

Instantly share code, notes, and snippets.

@2tony2
Created February 24, 2024 15:49
Show Gist options
  • Save 2tony2/80e2dc1196d36ce0d367a29b6e5ede15 to your computer and use it in GitHub Desktop.
Save 2tony2/80e2dc1196d36ce0d367a29b6e5ede15 to your computer and use it in GitHub Desktop.
An example docker compose for setting up dbt dev env with SSO
version: '3'
networks:
local_dev_network:
driver: bridge
ipam:
driver: default
config:
- subnet: 172.23.0.0/16
gateway: 172.23.0.1
volumes:
local-dbt-env-shell-history: # This basically let's docker auto-manage this volume.
services:
local-dbt-env:
profiles:
- development
platform: linux/amd64 # We force the platform for consistency.
build:
context: .
dockerfile: Dockerfile
volumes:
- /var/run/docker.sock:/var/run/docker-host.sock # Forwards the local Docker socket to the container.
- local-dbt-env-shell-history:/commandhistory # Volume that stores shell history between sessions
# Overrides default command so things don't shut down after the process ends.
command: /bin/zsh -c "while sleep 1000; do :; done"
env_file: devcontainer.env
ports:
- "60000-60010:60000-60010" # port forward the port range reserved for dynamic port use.
networks:
local_dev_network:
ipv4_address: 172.23.0.2 # We assign a static ip for more stable functionality of the python snowflake connector authentication.
environment:
- SF_AUTH_SOCKET_ADDR=172.23.0.2 # this forces the snowflake connector to use the static ip we assigned to the container as the recipient of the SSO token.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment