refactor to allow for multiple code locations

This commit is contained in:
2025-07-20 19:49:30 +02:00
parent 9b8cfabee5
commit fd73e1367c
40 changed files with 161 additions and 628 deletions

View File

@@ -4,15 +4,6 @@ x-dagster-env: &dagster_env
DAGSTER_POSTGRES_USER: ${POSTGRES_USER}
DAGSTER_POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
DAGSTER_POSTGRES_DB: ${POSTGRES_DB}
DAGSTER_CURRENT_IMAGE: ${DAGSTER_CURRENT_IMAGE}
x-volumes: &volumes
volumes:
#- /opt/dagster/storage/:/opt/dagster/home/storage/
- /opt/dagster/storage/import/:/opt/dagster/home/storage/import/
- /opt/dagster/storage/deals/:/opt/dagster/home/storage/deals/
- /opt/dagster/src/app/:/opt/dagster/home/app/
- /opt/dagster/src/repo.py:/opt/dagster/home/repo.py
services:
# This service runs the gRPC server that loads your user code, in both dagit
@@ -20,30 +11,37 @@ services:
# run launcher to use this same image when launching runs in a new container as well.
# Multiple containers like this can be deployed separately - each just needs to run on
# its own port, and have its own entry in the workspace.yaml file that's loaded by dagit.
user_code:
user_code_vinyl:
build:
context: .
dockerfile: Dockerfile.code
container_name: user_code
image: user_code_image
context: apps/vinyl
dockerfile: ../../Dockerfile.code
container_name: user_code_vinyl
image: user_code_vinyl
restart: always
environment:
<<: *dagster_env
<<: *volumes
DAGSTER_CURRENT_IMAGE: user_code_vinyl
PYTHONPATH: app
volumes:
- /opt/dagster/storage/import/:/opt/dagster/home/storage/import/
- /opt/dagster/storage/deals/:/opt/dagster/home/storage/deals/
- /opt/dagster/apps/vinyl/src/:/opt/dagster/home/app/
networks:
- dagster
other_image:
profiles: [ disabled ]
user_code_other:
# profiles: [ disabled ]
build:
context: .
dockerfile: Dockerfile
container_name: other_image
image: user_code_image
context: apps/other
dockerfile: ../../Dockerfile.code
container_name: user_code_other
image: user_code_other
restart: always
environment:
<<: *dagster_env
DAGSTER_CURRENT_IMAGE: something_else
<<: *volumes
DAGSTER_CURRENT_IMAGE: user_code_other
PYTHONPATH: app
volumes:
- /opt/dagster/apps/other/src/:/opt/dagster/home/app/
networks:
- dagster