Skip to content

Instantly share code, notes, and snippets.

@mikeatlas
Last active March 24, 2023 15:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mikeatlas/e0a47400a75f288262617405287f0586 to your computer and use it in GitHub Desktop.
Save mikeatlas/e0a47400a75f288262617405287f0586 to your computer and use it in GitHub Desktop.
"user code" / biz logic service for Dagster. All jobs/graphs/ops/etc live in the user_code directory
FROM python:3.10-slim-bullseye as dagster
RUN apt-get update && apt-get upgrade -yqq
ENV DAGSTER_HOME=/opt/dagster/dagster_home
RUN mkdir -p $DAGSTER_HOME/user_code
WORKDIR $DAGSTER_HOME
COPY dagster.yaml workspace.yaml $DAGSTER_HOME/
COPY requirements-dagster.txt $DAGSTER_HOME/
RUN pip install -r requirements-dagster.txt
FROM dagster as user_code
ENV PYTHONPATH $PYTHONPATH:$DAGSTER_HOME
COPY user_code/requirements.txt $DAGSTER_HOME
RUN pip install -r requirements.txt
COPY user_code/ $DAGSTER_HOME/user_code/
EXPOSE 8001
CMD [ "dagster", "api", "grpc", "-h", "0.0.0.0", "-p", "8001", "-f", "user_code/workspace.py" ]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment