Skip to content

Commit

Permalink
Add documentation explaining how to build the container image properly
Browse files Browse the repository at this point in the history
  • Loading branch information
waxlamp committed Nov 5, 2024
1 parent ec7e8a4 commit 2304643
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions DEVELOPMENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,13 @@
This is the simplest configuration for developers to start with.

### Initial Setup
1. Run `docker compose run --rm django ./manage.py migrate`
2. Run `docker compose run --rm django ./manage.py createcachetable`
3. Run `docker compose run --rm django ./manage.py createsuperuser --email $(git config user.email)`
1. Run `docker compose build --build-arg USERID=$(id -u) --build-arg GROUPID=$(id -g) --build-arg LOGIN=$(id -n -u)` to build the development container image. This builds the image to work with your (non-root) development user so that the linting and formatting commands work inside and outside of the container. If you prefer to build the container image so that it runs as `root`, you can omit the `--build-arg` arguments (but you will likely run into trouble running those commands).
2. Run `docker compose run --rm django ./manage.py migrate`
3. Run `docker compose run --rm django ./manage.py createcachetable`
4. Run `docker compose run --rm django ./manage.py createsuperuser --email $(git config user.email)`
and follow the prompts to create your own user.
This sets your username to your git email to ensure parity with how GitHub logins work. You can also replace the command substitution expression with a literal email address, or omit the `--email` option entirely to run the command in interactive mode.
4. Run `docker compose run --rm django ./manage.py create_dev_dandiset --owner $(git config user.email)`
5. Run `docker compose run --rm django ./manage.py create_dev_dandiset --owner $(git config user.email)`
to create a dummy dandiset to start working with.

### Run Application
Expand All @@ -21,7 +22,7 @@ This is the simplest configuration for developers to start with.
Occasionally, new package dependencies or schema changes will necessitate
maintenance. To non-destructively update your development stack at any time:
1. Run `docker compose pull`
2. Run `docker compose build --pull --no-cache`
2. Run `docker compose build --pull --no-cache --build-arg USERID=$(id -u) --build-arg GROUPID=$(id -g) --build-arg LOGIN=$(id -n -u)` (omitting the `--build-arg` arguments if you did so in Step 1 of *Initial Setup* above).
3. Run `docker compose run --rm django ./manage.py migrate`

## Develop Natively (advanced)
Expand Down

0 comments on commit 2304643

Please sign in to comment.