Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use explicit override #2625

Merged
merged 15 commits into from
Aug 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions {{cookiecutter.project_name}}/docker/django/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ ENV DJANGO_ENV=${DJANGO_ENV} \
PIP_DISABLE_PIP_VERSION_CHECK=1 \
PIP_DEFAULT_TIMEOUT=100 \
PIP_ROOT_USER_ACTION=ignore \
PIP_CONSTRAINT='/var/cache/pip_constraint.txt' \
# tini:
TINI_VERSION=v0.19.0 \
# poetry:
Expand All @@ -34,6 +35,9 @@ ENV DJANGO_ENV=${DJANGO_ENV} \

SHELL ["/bin/bash", "-eo", "pipefail", "-c"]

# Copy constrains for pip:
COPY docker/django/pip_constraint.txt /var/cache/pip_constraint.txt

# System deps (we don't use exact versions because it is hard to update them,
# pin when needed):
# hadolint ignore=DL3008
Expand Down Expand Up @@ -71,16 +75,15 @@ RUN groupadd -g "${GID}" -r web \
&& mkdir -p '/var/www/django/static' '/var/www/django/media' \
&& chown web:web '/var/www/django/static' '/var/www/django/media'

# Copy only requirements, to cache them in docker layer
# Copy only requirements, to cache them in docker layer:
COPY --chown=web:web ./poetry.lock ./pyproject.toml /code/

# Project initialization:
# hadolint ignore=SC2046
RUN --mount=type=cache,target="$POETRY_CACHE_DIR" \
echo "$DJANGO_ENV" \
&& poetry version \
# Install deps:
&& poetry run pip install -U pip \
&& poetry run pip install --constraint="$PIP_CONSTRAINT" pip \
&& poetry --version && poetry run pip --version \
&& poetry install \
$(if [ "$DJANGO_ENV" = 'production' ]; then echo '--only main'; fi) \
--no-interaction --no-ansi --sync
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
pip==24.2
Loading