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

Changing the command name docker-compose to docker compose #236

Merged
merged 1 commit into from
Dec 5, 2024
Merged
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
23 changes: 11 additions & 12 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ Using Docker
------------

* Install Docker
* ``pip install docker-compose``
* Create a ``secrets.json`` file at the root of the repository (next to `Dockerfile`), containing
something like::

Expand All @@ -30,22 +29,22 @@ Using Docker
"db_password": "secret"
}

* ``docker-compose up --build``
* ``docker compose up --build``
* Follow instructions above to create/load the DB, grant permissions, create the
config, etc. For example::

docker-compose up --build
docker compose up --build
export DATABASE_URL=postgres://code.djangoproject:secret@db/code.djangoproject
docker-compose exec -T db psql $DATABASE_URL < ../djangoproject.com/tracdb/trac.sql
docker-compose exec trac trac-admin /code/trac-env/ permission add anonymous TRAC_ADMIN
docker compose exec -T db psql $DATABASE_URL < ../djangoproject.com/tracdb/trac.sql
docker compose exec trac trac-admin /code/trac-env/ permission add anonymous TRAC_ADMIN

Using Podman
------------

It may be possible to use Podman for local development to more closely simulate
production. The above Docker instructions should work for Podman as well,
however, be aware that ``podman-compose`` is not as well battle-tested as
``docker-compose`` (e.g., it may require pruning or forcefully stopping a
``docker compose`` (e.g., it may require pruning or forcefully stopping a
container before it will rebuild properly).

How to port the CSS from djangoproject.com
Expand All @@ -69,16 +68,16 @@ How to recreate `trac.sql` after upgrading Trac

Start with a clean slate::

docker-compose down
docker compose down
sh -c 'cd ../djangoproject.com && git checkout tracdb/trac.sql'

Bring up database and Trac via docker-compose::
Bring up database and Trac via docker compose::

docker-compose up --build -d
docker compose up --build -d
export DATABASE_URL=postgres://code.djangoproject:secret@db/code.djangoproject
docker-compose exec -T db psql $DATABASE_URL < ../djangoproject.com/tracdb/trac.sql
docker-compose exec trac /venv/bin/trac-admin /code/trac-env/ upgrade
docker-compose exec db pg_dump --column-inserts -d $DATABASE_URL > ../djangoproject.com/tracdb/trac.sql
docker compose exec -T db psql $DATABASE_URL < ../djangoproject.com/tracdb/trac.sql
docker compose exec trac /venv/bin/trac-admin /code/trac-env/ upgrade
docker compose exec db pg_dump --column-inserts -d $DATABASE_URL > ../djangoproject.com/tracdb/trac.sql


Note:
Expand Down
Loading