Hey everyone! I’m also excited to (finally!) share...
# community-showcase
a
Hey everyone! I’m also excited to (finally!) share my technical blog post detailing how my repo above is able to hot-load code changes in a container and how poetry can be used for package management. Any feedback is welcome! • Blog PostGithub repo
❤️ 8
🎉 9
👍 1
s
This is great @Alex Service, wish i had this a month ago 🙂 . I've had success with a single stage dockerfile using basically the same folder setup. the key i found is to copy the files after running the install step, which will use the caching mechanism.
Copy code
FROM python:3.8-slim-buster

ENV POETRY_VERSION=1.1.13

# system dependencies
RUN pip install "poetry==$POETRY_VERSION"

# copy requirements to cache in docker layer
RUN mkdir /opt/code
WORKDIR /opt/code

# Project initialization
COPY pyproject.toml poetry.lock ./

# Install poetry to ensure Python dependencies are correct
RUN poetry config virtualenvs.create false \
    && poetry install --no-dev

COPY . .
I use the dagster cloud ci/cd and mount the repo as a package, and it works great
a
Glad you like it! And that’s an interesting approach; does hot-loading of code still work, or does the container still need restarted on changes? I’m guessing it still needs restarted, but is quicker than it would otherwise be
s
yeah, it still needs to be restarted, but i don't really do any interactive development using the container -- just use the poetry venv and `poetry run dagit --package-name my_package. `` The container is really just for deployment in my case
🎉 1
y
Hi @Alex Service it’s a great blog post! I’ve recently created this Github Discussion to help share projects that are using Dagster. Feel free to share your post and repo there!
a
Done! Thanks @yuhan 🙂
❤️ 1