Skip to content

Commit

Permalink
Rename the "app" Docker service to work around headless Chrome HSTS i…
Browse files Browse the repository at this point in the history
…ssue

It is now "application" and docs are updated accordingly.
This works around an error in integration testing with headless Chrome on Puppeteer 23.x,
since Chrome forces requests to the domain "app" to use SSL.
See: https://medium.com/@alex.skrypnyk/google-chrome-implementing-hsts-breaks-dockerized-application-testing-55120e6d67bc
  • Loading branch information
nateborr committed Oct 24, 2024
1 parent fd6a9a6 commit b54480c
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 14 deletions.
6 changes: 3 additions & 3 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
version: "3.0"
services:
app:
application:
build: .
volumes:
- ./tock:/tock
Expand Down Expand Up @@ -40,11 +40,11 @@ services:
context: .
dockerfile: Dockerfile-tests
links:
- app
- application
volumes:
- .:/home/circleci/project
- /home/circleci/project/node_modules
environment:
IS_DOCKER: "true"
TOCK_URL: "http://app:8000"
TOCK_URL: "http://application:8000"
command: /bin/true
4 changes: 2 additions & 2 deletions docs/dependency-management.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ With pipenv installed locally, you can update development and production depende
pipenv update --dev
```

Within the `app` docker container, the approach is slightly different due to the volumes and working_dir set in `docker-compose.yml`.
Within the `application` docker container, the approach is slightly different due to the volumes and working_dir set in `docker-compose.yml`.

```sh
docker-compose run app bash
docker-compose run application bash
$ pipenv update --dev
$ cp ../Pipfile.lock ./Pipfile.lock
# Exit docker container
Expand Down
18 changes: 9 additions & 9 deletions docs/local-development.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@

```shell
docker-compose build
docker-compose run app python manage.py migrate
docker-compose run app python manage.py loaddata test_data/data-update-deduped.json
docker-compose run app \
docker-compose run application python manage.py migrate
docker-compose run application python manage.py loaddata test_data/data-update-deduped.json
docker-compose run application \
python manage.py \
createsuperuser \
--username admin.user \
Expand Down Expand Up @@ -48,20 +48,20 @@ security-focused linter.

To run these tools locally, run:
```sh
docker-compose run app bandit -r . -x manage.py,docker_entrypoint.py
docker-compose run app flake8
docker-compose run application bandit -r . -x manage.py,docker_entrypoint.py
docker-compose run application flake8
```

### Accessing the app container
### Accessing the application container

You'll likely want to run `manage.py` to do other things at some point.
To do this, it's probably easiest to run:

```
docker-compose run app bash
docker-compose run application bash
```

This will run an interactive bash session inside the main app container.
This will run an interactive bash session inside the main application container.
In this container, the `/tock` directory is mapped to the `tock`
directory of the repository on your host; you can run `manage.py` from there.

Expand Down Expand Up @@ -92,7 +92,7 @@ The easiest, most reliable way to test locally is from within the docker contain
which lets you access `manage.py`:

```
docker-compose run app bash
docker-compose run application bash
python manage.py test
```

Expand Down

0 comments on commit b54480c

Please sign in to comment.