Skip to content

Commit

Permalink
fix: Improve developer experience (#344)
Browse files Browse the repository at this point in the history
* fix: Improve developer experience

- Alow for more flexibility in database dump filenames
- Fix indentation in the README Markdown
- Use Django's `runserver` instead of gunicorn
- Allow changing the port exposed by Docker
- Specify the Node version in `.nvmrc` that matches the frontend
  Dockerfile

* Restore gunicorn for development

---------

Co-authored-by: Alex Morega <[email protected]>
  • Loading branch information
mgax and mgax authored Nov 27, 2023
1 parent b350e84 commit 5ae412c
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
lts/erbium
16
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,15 @@ So the only requirement to run it locally is a recent version of Docker with doc

##### How to run (with a database dump)

1. Obtain a recent database dump with name like `ietfa.torchbox.*.gz` and place in `docker/database/` directory. Otherwise, it will start with a fresh database.
1. Obtain a recent database dump with name like `ietfa.*.gz` and place in `docker/database/` directory. Otherwise, it will start with a fresh database.
2. Obtain and unarchive media files into `media/` folder.
3. Run `docker compose up`. It will build and start the frontend builder (`yarn run start`) and the backend (`python manage.py runserver` analog), along with a Postgresql database. The first run will take a while because the database dump needs to be restored.
4. After the frontend compilation finishes, the website should become available at http://localhost:8001
5. Create a super user on **Python application** docker instance to access http://localhost:8001/admin

```sh
docker exec -ti wagtail_website-application-1 python manage.py createsuperuser
```
```sh
docker exec -ti wagtail_website-application-1 python manage.py createsuperuser
```

6. To destroy everything (i.e. start the database from scratch) run `docker compose down`.

Expand All @@ -54,9 +54,9 @@ docker exec -ti wagtail_website-application-1 python manage.py createsuperuser
1. Run `docker compose up`. It will build and start the frontend builder (`yarn run start`) and the backend (`python manage.py runserver` analog), along with a Postgresql database. The first run will take a while because the database dump needs to be restored.
2. Create an admin user

```sh
docker exec -ti wagtail_website-application-1 python manage.py createsuperuser
```
```sh
docker exec -ti wagtail_website-application-1 python manage.py createsuperuser
```

3. Log into http://localhost:8001/admin
4. Create a new "Home Page" (page type must be `Home Page`) and **publish**.
Expand Down
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ services:
volumes:
- ".:/app"
ports:
- "8001:8000"
- "${DOCKER_APPLICATION_PORT:-8001}:8000"
env_file:
- docker/dev.env
depends_on:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
cd /docker-entrypoint-initdb.d

set +e
FILE=$(ls -1 ietfa.torchbox.* | head)
FILE=$(ls -1 ietfa.*.gz | head)

set -e

Expand Down

0 comments on commit 5ae412c

Please sign in to comment.