Skip to content

Instantly share code, notes, and snippets.

@slopp
Created April 25, 2023 18:49
Show Gist options
  • Save slopp/aee14cda0068d6c7c798b418067b400e to your computer and use it in GitHub Desktop.
Save slopp/aee14cda0068d6c7c798b418067b400e to your computer and use it in GitHub Desktop.
Example Dagster Cloud Dockerfile
FROM python:3.10-slim
# Get the files that define dependencies
COPY *setup.py *requirements.txt /
# If setup.py exists, we install the dependencies before
# copying all other files
RUN if [ -f "setup.py" ]; then \
pip install .; \
fi
# If requirements.txt exists, we install the dependencies before
# copying all other files
RUN if [ -f "requirements.txt" ]; then \
pip install -r requirements.txt \
fi
# Copying over the dagster project code after installing the dependencies means changes to just the code
# will hit the cache
WORKDIR /opt/dagster/app
COPY . /opt/dagster/app
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment