Skip to content
This repository was archived by the owner on Aug 15, 2019. It is now read-only.
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: orf/django-docker-box
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: master
Choose a base ref
...
head repository: django/django-docker-box
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: main
Choose a head ref

Commits on Jul 23, 2019

  1. Copy the full SHA
    5d877b5 View commit details
  2. Copy the full SHA
    acfd88b View commit details

Commits on Jul 24, 2019

  1. Fixed psycopg2 installation.

    felixxm authored Jul 24, 2019
    Copy the full SHA
    7daafb1 View commit details

Commits on Aug 15, 2019

  1. Copy the full SHA
    1a07265 View commit details

Commits on Aug 16, 2019

  1. Add support for MariaDB 10.4 - Closes #3.

    orf authored and felixxm committed Aug 16, 2019
    Copy the full SHA
    e4ed1f2 View commit details

Commits on Oct 29, 2019

  1. Added Python 3.8 testing. (#12)

    felixxm authored and orf committed Oct 29, 2019
    Copy the full SHA
    417a843 View commit details

Commits on Oct 30, 2019

  1. Copy the full SHA
    3d3c817 View commit details

Commits on Jan 12, 2020

  1. remove geolite2, no longer accessible (#15)

    dbxnr authored and orf committed Jan 12, 2020
    Copy the full SHA
    fb358fc View commit details

Commits on Mar 24, 2020

  1. Copy the full SHA
    cb393d7 View commit details
  2. Copy the full SHA
    6784202 View commit details
  3. Copy the full SHA
    455a02a View commit details

Commits on May 19, 2020

  1. Copy the full SHA
    94e84b7 View commit details

Commits on Jan 3, 2021

  1. Copy the full SHA
    e5dc267 View commit details

Commits on Feb 13, 2021

  1. Copy the full SHA
    336bd2f View commit details

Commits on Mar 10, 2021

  1. Copy the full SHA
    91cff5c View commit details
  2. Copy the full SHA
    a4e52c7 View commit details
  3. Copy the full SHA
    70149b0 View commit details
  4. Copy the full SHA
    66e2330 View commit details

Commits on Oct 1, 2021

  1. Updated default POSTGRES_VERSION to 10.

    Follow up to 70149b0.
    abhiabhi94 authored Oct 1, 2021
    Copy the full SHA
    1884d03 View commit details
  2. Copy the full SHA
    350a7c8 View commit details
  3. Copy the full SHA
    2567436 View commit details
  4. Copy the full SHA
    6127b74 View commit details

Commits on Dec 24, 2021

  1. Copy the full SHA
    07e083c View commit details
  2. Used the official PostGIS docker image.

    orf authored and felixxm committed Dec 24, 2021
    Copy the full SHA
    9c21e8e View commit details
  3. Fixed #36 - Used slim-bullseye.

    This pins Python image to use Debian bullseye and updates third party
    dependencies.
    awtimmering authored Dec 24, 2021
    Copy the full SHA
    97731e6 View commit details
  4. Copy the full SHA
    38289e8 View commit details

Commits on Jan 14, 2022

  1. Fixed #29 -- Fixed crash of docs.

    This adds git to dependencies for the Docker image.
    awtimmering authored Jan 14, 2022
    Copy the full SHA
    e3221d2 View commit details

Commits on Jun 30, 2022

  1. Fixed #24 -- Changed default workdir to tests.

    Change workdir to django/tests to avoid cache related tests that depend
    on the test runner being executed from that directory, and that fail
    otherwise.
    awtimmering authored Jun 30, 2022
    Copy the full SHA
    b904502 View commit details

Commits on Jul 9, 2022

  1. Copy the full SHA
    3ee883b View commit details

Commits on Jul 12, 2023

  1. Added pkg-config for MariaDB/MySQL.

    It's required to build mysqlclient.
    felixxm authored Jul 12, 2023
    Copy the full SHA
    c483682 View commit details

Commits on Dec 11, 2023

  1. Copy the full SHA
    97d4b5a View commit details

Commits on Jan 7, 2025

  1. Refactored to fix multiple issues.

    * Removed references to `django-box` from README.
    
    The `django-box` repository was archived over 5 years ago and many
    people coming to this now will have no idea what Vagrant or VirtualBox
    even are.
    
    * Removed obsolete configuration for Travis CI.
    
    Travis CI was used when GitHub Actions was still very new and had
    limited support. Since then, Travis CI became less tolerant of open
    source projects and runtimes increased significantly. GitHub Actions
    provides much more flexibility and can be looked into as a replacement
    for this matrix of tests.
    
    * Removed obsolete configuration for Azure Pipelines.
    
    This looks incomplete and was likely considered as an alternative to
    Travis CI at some point. We should look into GitHub Actions as a
    replacement for running a matrix of tests.
    
    * Removed obsolete script for pushing images to Docker Hub.
    
    Ownership of the repository for images on Docker Hub is likely in the
    hands of the original author rather than the Django project itself. In
    addition, we should probably look at making use of the GitHub Container
    Repository instead which will be easier to manage and control.
    
    * Removed broken support for Oracle Database.
    
    We will be able to support Oracle again now that they have started
    publishing container images themselves via their own repository. It's
    easier to remove this broken support and start again, however, as -
    aside from using a very old version of Oracle Database - this approach
    required many hacks.
    
    * Removed obsolete version attribute from compose file.
    
    This raises a warning when running `docker compose`, so remove it.
    
    * Removed obsolete `GEOIP_PATH` setting.
    
    Django now bundles test Maxmind GeoIP and GeoLite databases which means
    that this setting - and a manual download of these databases - is no
    longer required.
    
    * Removed unused `PIP_CACHE_VOLUME` environment variable.
    
    Unused since 9c8e95f.
    
    * Renamed docker and compose files.
    
    Instead of `docker-compose.yml`, rename to `compose.yml` as supported by
    the Compose Specification. Also rename to `Containerfile` instead of
    using `Dockerfile` to be more tool-agnostic. It would be good to also
    support Podman if and when it supports all of the features we require.
    
    * Consolidated settings into a single file.
    
    Most settings are exactly the same, so by dynamically generating the
    `DATABASES` setting we can ensure greater consistency and reduce the
    maintenance required.
    
    The `TEST_RUNNER` and `TEST_OUTPUT_DIR` settings have been hidden behind
    an `XUNIT` environment variable. These are typically only useful in CI,
    specifically on Jenkins, suppress some output, and do not support
    various features such as debugging SQL output and test durations.
    
    * Preferred "PostgreSQL" over "Postgres".
    
    All other database use the full name, so do the same for PostgreSQL.
    
    * Grouped and reordered services in compose file.
    
    Grouped services and commands by type and ordered alphabetically within
    each section.
    
    * Removed obsolete entrypoint for MySQL.
    
    The MySQL native password authentication plugin is obsolete.
    
    * Extracted common compose configuration for services.
    
    This allow us to apply configuration consistently and reduce
    duplication.
    
    * Enforced single instance for backend services.
    
    And also ensure that they restart unless explicitly stopped.
    
    * Replaced `wait-for-it.sh` script with compose healthchecks.
    
    This integrates better with compose commands with feedback on service
    health. Note that this doesn't yet introduce healthchecks for selenium
    nodes as we'll be switching over to Selenium Grid in a future commit
    which works slightly differently and the current setup doesn't seem to
    work correctly.
    
    * Fixed indentation of compose file.
    
    * Improved name of memcached services.
    
    * Fixed MySQL to use the same credentials as other databases.
    
    Prior to this MySQL and MariaDB were creating a "django" user, but were
    using "root" because the user didn't have the appropriate permissions.
    Fixing that brings the credentials used in line with PostgreSQL.
    
    * Fixed support for Selenium using Selenium Grid.
    
    Also reintroduces healthchecks.
    
    * Optimized services for testing.
    
    This disables various features in databases and attempts to reduce disk
    writes such that testing is as fast as possible.
    
    * Reinstated support for Oracle database.
    
    This is now using the images provided by Oracle in their own container
    registry.
    
    * Added GIS support for MariaDB.
    
    * Added support for Redis cache backend.
    
    Ensures that tests can be run for the cache backend for Redis.
    
    * Added support for running Selenium with Edge.
    
    * Enabled cache backends for GIS tests.
    
    There's not much reason why these need to be disabled.
    
    * Created improved folder structure under `/django`.
    
    Use the top-level `/django` folder as a place to copy files and mount
    volumes. The Django source code will now be mounted to `/django/source`
    and any generated output, e.g. coverage, will be output to a mounted
    volume at `/django/output`.
    
    It is also no longer necessary to specify the `DJANGO_PATH` environment
    variable if you have your Django respository checked out alongside this
    one, e.g.
    
    ```
    ~/Sources
    ├── django
    └── django-docker-box
    ```
    
    If you keep your source elsewhere, then the default of `../django` can
    still be overridden using `DJANGO_PATH`.
    
    Currently the Django sources are mounted read-write. This is due to
    various tools that are currently configured to write output into the
    source tree, e.g. coverage. In addition, some tests may write files to
    the source tree instead of a temporary location. Hopefully we can
    gradually address these issues and then move to mounting the source tree
    read-only instead.
    
    This commit also sets up the Django source tree as an additional context
    instead of the default context. This will allow including files from
    this repository during the image build but also sets up sourcing
    requirements files from the source tree which will be crucial to
    improving the container file.
    
    * Extracted packages into separate files.
    
    It's much easier to maintain a list of packages to install in a separate
    file. We can also get the packages required to build the documentation
    from the requirements file in the Django source tree.
    
    * Changed user name in container from `test` to `django`.
    
    * Modernized and optimized container file.
    
    Use modern syntax including heredocs, cache mounts, etc. Also merge the
    requirements files to reduce to a single install command.
    
    * Switched to `uv` for installing packages.
    
    * Added a basic entrypoint script.
    
    This will be expanded in future for enabling coverage, etc.
    
    * Added a `LICENSE` file.
    
    * Added some labels to the container image.
    
    * Updated to use Debian Bookworm.
    
    Also update some packages to install the dev packages. These will
    install the correct runtime libraries and keeps this maintainable - the
    version numbers in the package names can change with each distro update,
    so using the dev package avoids manual updates.
    
    * Added support for running with PyPy.
    
    * Enforced color output when running in CI.
    
    Ensure that we'll get colored output when running in GitHub Actions.
    
    * Updated `.editorconfig`.
    
    * Replaced `flake8` with `pre-commit`.
    
    Using `pre-commit` makes it easier to run all linters with the versions
    pinned by Django. Also add `black` as a dependency so that migrations
    which are created when using these images will be formatted.
    
    * Added linting tools and workflow for this repository.
    
    * Added more entries to `.gitignore` file.
    
    * Reordered entries in the `.env` file.
    
    * Updated the charset for MariaDB/MySQL.
    
    Recently this was updated to use `utf8mb4` for Django 5.2
    
    * Removed stale container image cache location.
    
    Hopefully we'll reinstate this in the future, but make use of GitHub
    Container Registry. It'll be easier to maintain and we should be able to
    publish all versions on a regular basis from a GitHub Actions workflow.
    
    * Reworked commands for building documentation, etc.
    
    * Bumped database versions to those supported on Django main.
    
    * Removed reference to `${PWD}` from `compose.yaml`.
    
    This isn't necessary - we can just use the current directory as there is
    a lot of other stuff already doing that. Using `${PWD}` makes using this
    on Windows more awkward as this environment variable is undefined by
    default.
    
    * Reworked documentation in `README.md`.
    
    Add much more guidance on using the tools within this repository.
    ngnpope authored Jan 7, 2025
    Copy the full SHA
    9a2102b View commit details

Commits on Jan 29, 2025

  1. Copy the full SHA
    385e14a View commit details

Commits on May 12, 2025

  1. Copy the full SHA
    f4458a4 View commit details
  2. Fix git clone path

    Kelvin4664 authored and charettes committed May 12, 2025
    Copy the full SHA
    723d0cf View commit details

Commits on Jun 10, 2025

  1. Copy the full SHA
    59dc04a View commit details
8 changes: 0 additions & 8 deletions .azure.yml

This file was deleted.

4 changes: 2 additions & 2 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
.git/
.dockerignore/
django
.dockerignore
output/
8 changes: 4 additions & 4 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
root = true

[*]
indent_style = space
charset = utf-8
end_of_line = lf
indent_size = 4
indent_style = space
insert_final_newline = true
trim_trailing_whitespace = true
end_of_line = lf
charset = utf-8

[*.yml]
[*.{yaml,yml}]
indent_size = 2
13 changes: 7 additions & 6 deletions .env
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
PYTHON_VERSION=3.6
POSTGRES_VERSION=9.6
POSTGIS_VERSION=2.5
MYSQL_VERSION=8
MARIADB_VERSION=10.3
PIP_CACHE_VOLUME=pip-cache
PYTHON_IMPLEMENTATION=python
PYTHON_VERSION=3.12
MARIADB_VERSION=10.6
MYSQL_VERSION=8.0
ORACLE_VERSION=23.5.0.0
POSTGRESQL_VERSION=14
POSTGIS_VERSION=3.1
40 changes: 40 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
---
name: Lint

on: # yamllint disable-line rule:truthy
pull_request:
push:
branches:
- main

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

permissions:
contents: read

env:
COLUMNS: '120'
FORCE_COLOR: '1'

jobs:
pre-commit:
runs-on: ubuntu-latest
name: pre-commit
steps:
- name: Checkout
uses: actions/checkout@v4
with:
persist-credentials: false
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.13'
cache: pip
- name: Install packages
run: python -m pip install --upgrade pip pre-commit
- name: Run linting tools
run: pre-commit run --all-files
env:
PRE_COMMIT_COLOR: always
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
__pycache__/
.idea/
oracle/*.zip
.mypy_cache/
.ruff_cache/
5 changes: 5 additions & 0 deletions .hadolint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
ignored:
- DL3013 # Don't complain when upgrading to latest version of pip
- DL3022 # Due to use of additional_contexts in compose.yaml
- DL3042 # Caching is desired with RUN --mount=type=cache
53 changes: 53 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
---
ci:
autoupdate_schedule: weekly
repos:
- repo: meta
hooks:
- id: check-hooks-apply
- id: check-useless-excludes
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
- id: check-added-large-files
- id: check-builtin-literals
- id: check-case-conflict
- id: check-docstring-first
- id: check-executables-have-shebangs
- id: check-merge-conflict
- id: check-shebang-scripts-are-executable
# - id: check-toml
- id: check-vcs-permalinks
- id: check-yaml
- id: debug-statements
- id: detect-private-key
- id: end-of-file-fixer
- id: file-contents-sorter
args: [--unique]
files: ^(?:packages|requirements)\.txt$
- id: fix-byte-order-marker
- id: fix-encoding-pragma
args: [--remove]
- id: requirements-txt-fixer
- id: trailing-whitespace
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.8.2
hooks:
- id: ruff
args: [--exit-non-zero-on-fix, --fix]
- id: ruff-format
args: [--check]
- repo: https://github.com/adrienverge/yamllint.git
rev: v1.35.1
hooks:
- id: yamllint
args: [--strict]
- repo: https://github.com/hadolint/hadolint
rev: v2.12.0
hooks:
- id: hadolint-docker
name: hadolint
- repo: https://github.com/woodruffw/zizmor-pre-commit
rev: v0.9.2
hooks:
- id: zizmor
111 changes: 0 additions & 111 deletions .travis.yml

This file was deleted.

66 changes: 66 additions & 0 deletions Containerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
# syntax=docker/dockerfile:1.12

ARG PYTHON_IMPLEMENTATION=python
ARG PYTHON_VERSION=3.12
FROM ${PYTHON_IMPLEMENTATION}:${PYTHON_VERSION}-slim-bookworm

LABEL org.opencontainers.image.authors="Django Software Foundation"
LABEL org.opencontainers.image.url="https://github.com/django/django-docker-box"
LABEL org.opencontainers.image.documentation="https://github.com/django/django-docker-box"
LABEL org.opencontainers.image.source="https://github.com/django/django-docker-box"
LABEL org.opencontainers.image.vendor="Django Software Foundation"
LABEL org.opencontainers.image.licenses="BSD-3-Clause"
LABEL org.opencontainers.image.title="Django Docker Box"
LABEL org.opencontainers.image.description="Container image for developing and testing Django."

SHELL ["/bin/bash", "-o", "errexit", "-o", "nounset", "-o", "pipefail", "-o", "xtrace", "-c"]

ENV DEBIAN_FRONTEND=noninteractive
ENV PYTHONUNBUFFERED=1

# Force colored output for various tooling in CI.
ENV COLUMNS=120
ENV FORCE_COLOR=1
ENV TERM="xterm-256color"

# Create user and prepare directories.
RUN <<EOF
useradd --home-dir=/django --no-create-home --no-log-init django
mkdir --parents /django/{.cache,output,source}
chown --recursive django:django /django
EOF

# Install system dependencies from package manager.
COPY --chown=django:django packages.txt /django/
RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
--mount=type=cache,target=/var/lib/apt,sharing=locked <<EOF
rm --force /etc/apt/apt.conf.d/docker-clean
echo 'Binary::apt::APT::Keep-Downloaded-Packages "true";' > /etc/apt/apt.conf.d/keep-cache
apt-get update --quiet --yes
xargs --arg-file=/django/packages.txt apt-get install --no-install-recommends --yes
EOF

# Install all Python requirements in a single command.
COPY --chown=django:django requirements.txt /django/requirements/extra.txt
COPY --chown=django:django --from=src tests/requirements/ /django/requirements/
COPY --chown=django:django --from=src docs/requirements.txt /django/requirements/docs.txt
COPY --from=ghcr.io/astral-sh/uv:latest /uv /bin/
RUN --mount=type=cache,target=/root/.cache/uv <<EOF
cat /django/requirements/*.txt \
| grep --invert-match '^#' \
| sort --unique --version-sort \
| tee /django/requirements.txt
uv pip install --requirement=/django/requirements.txt --system
EOF

COPY --chown=django:django entrypoint.bash /django/

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

ENV DJANGO_SETTINGS_MODULE=settings
ENV PYTHONPATH="${PYTHONPATH}:/django/source/"
USER django:django
VOLUME /django/output
VOLUME /django/source
WORKDIR /django/source/tests
ENTRYPOINT ["/django/entrypoint.bash"]
42 changes: 0 additions & 42 deletions Dockerfile

This file was deleted.

9 changes: 0 additions & 9 deletions Dockerfile-postgis

This file was deleted.

Loading