From: You-Sheng Yang Date: Thu, 9 Dec 2021 03:38:39 +0000 (+0800) Subject: docker: Remove deprecated startup arguments X-Git-Tag: v3.1.0~40 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=94a240a01e6f5686ae30649df6ad40b7107987a7;p=thirdparty%2Fpatchwork.git docker: Remove deprecated startup arguments This also adds a default CMD directive so that it will launch a patchwork instance when started with no argument. Signed-off-by: You-Sheng Yang Signed-off-by: Stephen Finucane [stephenfin] Removed release note, since this is not end-user focused --- diff --git a/docker-compose-pg.yml b/docker-compose-pg.yml index 8056d62e..e703b96b 100644 --- a/docker-compose-pg.yml +++ b/docker-compose-pg.yml @@ -16,7 +16,6 @@ services: - GID depends_on: - db - command: python3 manage.py runserver 0.0.0.0:8000 volumes: - .:/home/patchwork/patchwork/ ports: diff --git a/docker-compose.yml b/docker-compose.yml index 103f19f9..b91b7ef8 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -18,7 +18,6 @@ services: - GID depends_on: - db - command: python3 manage.py runserver 0.0.0.0:8000 volumes: - .:/home/patchwork/patchwork/ ports: diff --git a/docs/development/installation.rst b/docs/development/installation.rst index 3507f435..c5c02694 100644 --- a/docs/development/installation.rst +++ b/docs/development/installation.rst @@ -60,7 +60,7 @@ To run a shell within this environment, run: .. code-block:: shell - $ docker-compose run --rm web --shell + $ docker-compose run --rm web /bin/bash To run ``django-manage`` commands, such as ``createsuperuser`` or ``migrate``, run: @@ -85,7 +85,7 @@ Likewise, to restore an older version of the database, run: .. code-block:: shell - $ docker-compose run --rm -web python manage.py dbrestore + $ docker-compose run --rm web python manage.py dbrestore To run unit tests against the system Python packages, run: diff --git a/tools/docker/Dockerfile b/tools/docker/Dockerfile index 8680957f..ceacc091 100644 --- a/tools/docker/Dockerfile +++ b/tools/docker/Dockerfile @@ -38,5 +38,6 @@ RUN pip install -r /opt/requirements-dev.txt COPY tools/docker/entrypoint.sh /usr/local/bin/entrypoint.sh ENTRYPOINT ["/usr/local/bin/entrypoint.sh"] +CMD ["python3", "manage.py", "runserver", "0.0.0.0:8000"] USER patchwork WORKDIR /home/patchwork/patchwork diff --git a/tools/docker/entrypoint.sh b/tools/docker/entrypoint.sh index faa36b3b..7e0af5a4 100755 --- a/tools/docker/entrypoint.sh +++ b/tools/docker/entrypoint.sh @@ -133,20 +133,10 @@ elif ! test_database; then reset_data fi -# TODO(stephenfin): Deprecated the --test, --tox, --quick-test and --quick-tox -# flags in a future release if [ $# -eq 0 ]; then # we probably ran with --reset and nothing else # just exit cleanly exit 0 -elif [ "$1" == "--shell" ]; then - exec bash -elif [ "$1" == "--test" ] || [ "$1" == "--quick-test" ]; then - shift - python manage.py test $@ -elif [ "$1" == "--tox" ] || [ "$1" == "--quick-tox" ]; then - shift - tox $@ -else # run whatever CMD is set to - $@ fi + +exec "$@"