Skip to content

Commit

Permalink
Merge pull request #299 from kitware-resonant/docker-mount
Browse files Browse the repository at this point in the history
Mount the full source tree during Docker image build
  • Loading branch information
brianhelba authored Feb 7, 2025
2 parents bd39b88 + 7a977e3 commit 990bab1
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions {{ cookiecutter.project_slug }}/dev/django.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,9 @@ FROM python:3.13-slim
ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONUNBUFFERED 1

# Only copy the pyproject.toml, it will still force all install_requires to be installed,
# but find_packages() will find nothing (which is fine). When Docker Compose mounts the real source
# over top of this directory, the .egg-link in site-packages resolves to the mounted directory
# and all package modules are importable.
COPY ./pyproject.toml /opt/django-project/pyproject.toml
RUN pip install --editable /opt/django-project[dev]
# Docker Compose will also mount this at runtime.
RUN --mount=source=.,target=/opt/django-project \
pip install --no-cache-dir --editable /opt/django-project[dev]

# Use a directory name which will never be an import name, as isort considers this as first-party.
WORKDIR /opt/django-project

0 comments on commit 990bab1

Please sign in to comment.