Hiroto Yamakawa
08/28/2023, 11:51 AMuser_code
. Am I missing something in my mental model?
Initially, I was copying that directory during the image built and this method works, but I want to avoid having to docker compose build
and docker compose up
every time I change something.Hiroto Yamakawa
08/28/2023, 11:55 AMdaniel
08/28/2023, 12:06 PMHiroto Yamakawa
08/29/2023, 1:11 PMcontainer_kwargs
?
in prod I don't have the issue since the project folder will be within the image and the aws role configuration is handled by ECS directly
run_launcher:
module: dagster_docker
class: DockerRunLauncher
config:
env_vars:
- [...]
networks:
- [...]
container_kwargs:
volumes: # Make docker client accessible to any launched containers as well
- /var/run/docker.sock:/var/run/docker.sock
- /tmp/io_manager_storage:/tmp/io_manager_storage
- $HOME/.aws:/root/.aws
- $(pwd)/bi_dagster:/opt/dagster/dagster_home/bi_dagster
daniel
08/29/2023, 1:21 PMHiroto Yamakawa
08/29/2023, 1:21 PMHiroto Yamakawa
08/30/2023, 6:58 AMcontainer_kwargs:
volumes: # Make docker client accessible to any launched containers as well
- /var/run/docker.sock:/var/run/docker.sock
- /tmp/io_manager_storage:/tmp/io_manager_storage
- ${HOME_LOCAL}/.aws:/root/.aws
- ${PWD_LOCAL}/bi_dagster:/opt/dagster/dagster_home/bi_dagster
In my DockerFile
FROM dagster as dagster-dev
COPY ./dagster.dev.yaml dagster.yaml
#REPLACE $HOME_LOCAL and $PWD_LOCAL
COPY .env_build .env
RUN chmod +x .env
RUN . $DAGSTER_HOME/.env && eval "echo \"$(cat dagster.yaml)\"" > dagster.yaml
and in my Makefile,
multi-build:
@echo "HOME_LOCAL=$(HOME)" > .env_build
@echo "PWD_LOCAL=$(PWD)">> .env_build
docker compose -f docker-compose.yml build
@rm .env_build
As an alternative solution:
I am pretty sure you can add them as Env variable in your docker compose, and then
command:
eval "echo \"$(cat dagster.yaml)\"" > dagster.yaml && dagster-daemon run
Hiroto Yamakawa
08/30/2023, 7:07 AMcommand: >
sh -c 'eval "echo \"$(cat dagster.yaml)\"" > dagster.yaml &&
dagster code-server start -h 0.0.0.0 -p 4000 -m bi_dagster'